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

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


> > > >
> > > > 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'.
>
> Very good point! Did not think about that one.

Actually, neither did I (at first). But came across it when I didn't find the
twisities where I expected them :-)

Another hack which you've probably already figured out/implemented so I'll
just put it in short:
Since contents.rdf contains a list of _all_ contained objects, the folderish
ones have to be identified for the tree. This can be done by setting
zp:Folderish="&isPrincipiaFolderish;" in the RDF and using <rule
zp:Folderish="1"> in the XUL for the tree.

Also, I had some problems getting the top level 'Zope' root of the tree to
show. I had to finally use a new rdf file (treeroot.rdf) which looks like this
(usual surrounding RDF omitted):

<rdf:Seq about="Zope:Treeroot"
  dc:Title="&dtml.missing-title;"
  dc:Identifier="&dtml-id;"
  dc:Date="&dtml.missing-bobobase_modification_time;"
  dc:Type="&dtml.missing-meta_type;"
  <dtml-if icon><dtml-call "REQUEST.set('iconURL', '%s/%s' % (BASE1,
icon))"></dtml-if>
  nc:Icon="&dtml.missing-iconURL;">

  <rdf:li>
  <rdf:Description about="http://michigan:8080"
                   dc:Title="Zope"
                   dc:Identifier=""
                   dc:Date="2000/01/11 00:11:43.296"
                   dc:Type="Folder"
                   zp:Folderish="1"
                   nc:Icon="http://michigan:8080/misc_/OFSP/Folder_icon.gif"
/>
  </rdf:li>
</rdf:Seq>

Then in the XUL tree have datasource="http://zoperoot/treeroot.rdf" and
ref="Zope:Treeroot". I couldn't get it to work if I put this RDF snippet in
the root contents.rdf (wonder why).

Shalabh