[Zope] Recursive Display Of All Folder Items
Dennis Allison
allison at shasta.stanford.edu
Tue Dec 13 15:40:27 EST 2005
Read the documentation for <dtml-tree>. You should be able to use it
to generate the information you want.
On Tue, 13 Dec 2005, J Cameron Cooper wrote:
> Francisco Chamorro wrote:
> > Hi everyone, I am trying to get a dump of all the content currently in
> > our zope server. Using DTML I was able to get the top level folders to
> > display their content but I am unable to recursively display the
> > contents of the sub-folders.
> >
> > This is the code I am using for my top level folders, where "TV" is the
> > name of the folder I want to display.
> >
> > <dtml-in "TV.objectValues()"><dtml-var id><br></dtml-in>
> >
> >
> > My second attempt at displaying sub-folder content was the following:
> >
> > <dtml-in "TV.objectItems()">
> > id: <dtml-var id>,<br>
> > type: <dtml-var meta_type><br>
> > <dtml-if "meta_type=='Folder'">
> > <dtml-in expr="objectValues(<dtml-var id>)">
> > id: <dtml-var id>,<br>
> > type: <dtml-var meta_type><br>
> > </dtml-in>
> > </dtml-if>
> > </dtml-in>
> >
> > But that also fails. I searched the documentation and found a post
> > about recursively calling the same function but that did not work as I
> > get a "excessive recursion" error. Any help on this problem would be
> > greatly appreciated.
>
> objectValues is acquired on all objects, even non-folderish ones. Thus
> recursion never stops. You must ask for it explicitly:
> aq_inner.aq_explicit or something like that if I remember directly.
>
> --jcc
>
--
More information about the Zope
mailing list