tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hunter <mhun2...@bigpond.net.au>
Subject Re: Accessing the "Global" object & The Tacos-Tree Stuff
Date Tue, 23 Sep 2003 10:57:54 GMT
Thanks for your help. It wasn't exactly the problem i was alluding to - 
but you description did help me solve some others.

I must admit that the tree (plus tapestry in general) are working out 
better than i thought (a pleasant surprise given many other commercial 
and open-source toolkits i've worked on).

Once again - thanks.

Mark

tsvetelin wrote:
> Hi Mark,
> 
> Here are some points about the tree.
> 
> The tree structure is:
> 	Model Structure:
> 		1. ITreeDataModel - a class that contains the tree structure in the form
> of data objects.
> 		2. ITreeStateModel - a class that contains a tree state - a Set of
> expanded nodes; last selected node; and has functions to expand and collapse
> a node.
> 		3. ITreeModel - a class that contains the above 2 classes.
> 		4. ITreeSessionStateManager - a class that determines what data will be
> stored in the session. There are two default implementations of this
> interface in the package net.sf.tapestry.contrib.tree.simple. The first one
> FullSessionStateManager store ITreeModel to the session (including nodes,
> state for expanded nodes). The second one NullSessionStateManager don't
> store anything in the session. Every one could make implementation of this
> interface and will determine which data will be stored - for example -
> session state manager that store only state for expanded nodes.
> 		5. ISessionStoreManager - a class that determines where to store the
> session data.
> 		6. ITreeNodeRenderFactory - a class that returns a different IRender for a
> particular node type (allows polymorphism).
> 
> 	View structure:
> 		1. TreeNodeView.jwc - a component that displays a node. It takes a
> parameter INodeRenderFactory (not required) and can get from it a custom
> node presentation as an IRender. TreeNodeView can make a direct link that
> may or may not surround a custom node presentation. The node can show the
> default node images ('+' or '-' image) or you can specify custom node
> images. To support a custom action handling you must supply a
> ITreeNodeRenderFactory.
> 		2. TreeDataView.jwc - a component that takes a tree data model and renders
> every node that is in the expanded set in ITreeStateModel. This component
> wraps a TreeNodeView.
> 		3. TreeView.jwc - the root component of the tree. It takes the following
> parameters: ITreeModel - required; nonrequired - ITreeSessionManager,
> ISessonStoreManager.
> 
> 
> 
>>However, in the Tacos-Tree, the code used to create/generate nodes on
>>the tree do not inherit from any class that would enable me to obtain
>>the required references. Of course, i could change the code to inherit
> 
>>from the "BaseComponent" class - but this sounds very naff (bad).
> 
> I am not sure that I understand which code should inherit something from
> tapestry. You could use a delegation rather than inheritance and this is
> apropriate for all implementations of tree model interfaces -
> ITreeDataModel, ITreeModel and ITreeSessionStateManager. So if you would
> like to construct your TreeDataModel that will obtain the tree nodes form
> Global object you should make implementation of this interface and pass a
> object that will be source of Global object.
> 
> 
> Tsvetelin.
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Mark Hunter
> Sent: Thursday, September 18, 2003 7:20 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Accessing the "Global" object & The Tacos-Tree Stuff
> 
> 
> I am having a little bit of a problem with the Tacos-Tree/Global object
> issue.
> 
> Basically, i am constructing a tree that depicts/navigates a set of
> objects existing as EJBs on the AppServer.
> 
> I am having no problems accessing these EJBs via code that inherits the
> BasePage or BaseComponent classes, since then i can call
> getPage().getEngine() calls and make use of functions there to access
> and manipulate a "global" object containing the Home/Context references.
> 
> 
> 
> Instead, is there a way to (say) access/find the "Global" object through
>   some utility or the like?
> 
> Thanks in advance.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message