[albatross-users] Help with al-trees

Sheila King sheila at thinkspot.net
Sun Jan 11 19:51:39 EST 2004


Hello,

Having some major difficulties "zen"-ing the Lazy Iterator Albatross tree
thingies.

I have been able to create a simple al-tree that displays all nodes by
copying somewhat from the tree1 example in the albatross samples directory.

However, making the leap to Lazy trees is proving difficult. I'm still
going through the mailing list archives, but I have some nagging questions
that I hope someone will be able to answer...

(1) What is the difference between "selected" nodes and "open" nodes? If
selected, but not open, a node would be shown but it's children would not
be shown? Doesn't this imply that all open nodes must necessarily be
selected?

(2) The examples (tree1, tree2, tree3) included in the samples directory do
not show in any way subclassing or instantiating any of the albatross
TreeIterator object classes. My understanding, is that one defines a
node-type object class of their own, builds their own tree using the
node-type class they have defined, and then in the HTML template file,
where the iter attribute is specified, albatross creates an appropriate
instance of a TreeIterator class?

So I'm a bit confused by this message from the mailing list archives:
http://www.object-craft.com.au/pipermail/albatross-users/2002-December/0002
57.html

where it is shown to create an instance of a LazyTreeIterator object?

I'm not grokking the relationship between ctx.locals.root and ctx.locals.hn
in that example? Does this mean that in the HTML template file, one would
set the iter attribute in the al-tree tag to be hn ?

(3) I wrote some code that used just regular Tree object (ok, I realize
there is not tree class, only a TreeIterator class, but you know what I
mean...). It worked fine to display the whole tree. 

Then I tried to switch to a lazy tree and display only nodes that I want to
see (not the whole tree). But I'm apparently totally misunderstanding the
open_aliases and selected_aliases thing. I've tried to write my own
definitions for those functions, and then set them in my page_display code,
but to no effect. Only the root node, and with no children, was displayed
on my page. Then I tried subclassing the LazyTreeIterator for my node
object class, since (from viewing albatross source code) I see that the
LazyTreeIterator already has set_open_aliases and set_selected_aliases
defined. But I got the same results as before, just only displaying the
root node of my tree, with no children.

<sigh>

Any tips, suggestions or clues appreciated.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list