[Zope-Moz] ANNOUNCE: Zope management tree in Mozilla

Shalabh Chaturvedi shalabh@pspl.co.in
Tue, 11 Jan 2000 22:22:05 +0530


From: Martijn Pieters <mj@digicool.com>
>
>                              <snipped>
> >
> > I think we can do without removing the datasources on closing
> > treeitems. Once
> > the user has expanded a tree item, we can let the
> > corresponding contents.rdf
> > remain a datasource.
> >
> > We have the persistence problem and I'll experiment here to look for a
> > solution. We may not remove datasources on collapse but we do
> > not need to
> > persist all the loaded datasources across sessions.
> >
>
> The problem here is that the server will get unnecessarily flooded with
> requests for RDF data that is not visible in the tree anymore, when
> restoring the tree in a later session.

That's right. On a new session start, we need to loadup only those data
sources that are needed for the visible part of the tree.

> I believe that the idea is very good, especially from a caching point of
> view. But we have to make sure that we don't persist any more
> datasources than we have to. Here's my idea:
>
> Every time a user opens up a branch, the new datasource gets added to a
> JavaScript dictionary (to use a Python term). We could maybe avoid
> adding the datasource to the tree when already in the dictionary, but
> this makes no difference to Mozilla right now. If it already has a
> datasource loaded, it won't do so again.
>
> Now, when a user closes a branch, we remove the datasource name _only
> from the dictionary_. And when the window is closed, we persist the
> dictionary. On reopening the window, the dictionary is populated with
> the persisted data, and we add all these datasources to the tree again.

I was thinking of something similar too. How do you plan to persist the
dictionary? We can try to put it as a string of concatenated URIs (with
whitespace) in the datasources attribute of the tree element itself. And also
put in 'persist="datasources"'.
Just an idea - haven't tested it.

> I'll go and implement this today.

Great ! (hmm...now what do I do?)

> >
> > An unrelated small functionality I've put in is a zp:Empty
> > attibute in the RDF
> > which is set to "true" <dtml-if tpValues>. It is used in the
> > XUL so that
> > twisties are shown only for non-empty treeitems.
>
> If you remove the 'container="true"' attribute, the above hack is not
> necessary, as Mozilla will find out whether or not they are empty by
> itself.

Yes, but when the contents.rdf for the contents of a folder is not loaded up,
mozilla doesn't know if the folder is empty or not.
So, no twisties are shown initially. You have to expand a treeitem 'A' (this
would load up the contents.rdf with the contents of A), then collapse the
parent treeitem of 'A' and reexpand it to see the twisty next to 'A'.


Shalabh