[Zope] Tree state interaction with acquisition

Bruce Elrick belrick@saltus.ab.ca
Thu, 09 Sep 1999 11:25:02 -0600


I'm trying to understand how acquisition of objects with tree tags affects the
tree's state (or is that trees' state?).

My index_html DTML_Method in the root folder is acquired almost everywhere.
It includes (via dtml-var) my treenav DTML_Method in the root folder which
implements the following:
<dtml-tree
  expr="PARENTS[-1]"
  skip_unauthorized=1 sort=title_or_id
  branches_expr="navigate_filter('hidden',1,cat='Folder',acquire=0,negate=1)"
  >
  <dtml-if hidden>
     <!--Skipping hidden-->
  <dtml-else>
    <a href="<dtml-var absolute_url>"><!--#var title_or_id--></a>
  </dtml-if>
</dtml-tree>
<a href="<!--#var URL0-->?collapse_all=1">Collapse tree</a><br>
<a href="<!--#var URL0-->?expand_all=1">Expand tree</a><br>

As I jump around my site, the tree's state behaviour behaves strangely.

For example, if I'm at the root and I expand the tree then click on one
of the folder links (which are clean URL's to the folder since I use the
absolute_url var), the state of the tree rendered there may be different,
especially if I subsequantly jump somewhere else.

If you have this:
  root--+--A--+--AA--+--AAA
        |     |      +--AAB
        |
    |
        |     +--AB--+--ABA
        |            +--ABB
        |
        +--B--+--BA--+--BAA
        |     |      +--BAB
        |
    |
        |     +--BB--+--BBA
        |            +--BBB
        ...

with index_html being in the root along with treenav, both being DTML_Methods,
with index_html including treenav using <dtml-var treenav>

Then when you browse to
http://site.com/A/AA/AAA/index_html
http://site.com/B/BA/BAB/index_html
is the "tree" the same tree?  By same, I am refering to the fact that it
stores a cookie which affects the tree state when it is not called with
.../index_html?tree-e=...

I know the 'expr="PARENTS[-1]"' in the tree affects things, but I don't know
how.  I know when http://site.com/A/AA/AAA/index_html uses <dtml-var treenav>,
it acquires it from the root folder, but does that make the tree and its state
the same "tree"?

Perplexedly yours...
Bruce

P.S.  I am trying to avoid using frames, which is why I acquire the index_html
and its navigation tree.

--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Cell:     (403) 870-4429
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP