iterating over localfs objects
Hi, I *know* this one is simple but I'm really stuck... I can't find anything in zope.org. How do I display all localfs objects ? I imagine it should be sth simple like: <dtml-in "object-type='localfs'"> <dtml-var sequence-item> </dtml-in> TIA, Dimitris @ Nuclear
ÄçìÞôñçò ÁíäñáêÜêçò wrote:
<dtml-in "object-type='localfs'"> <dtml-var sequence-item> </dtml-in>
<dtml-in "objectValues(['LocalFS'])"> ...or whatever the Local FS metatype is. jfarr may be able to help... cheers, Chris
Check out http://www.zope.org/Members/jfarr/Products/LocalFS/faq and http://www.zope.org/Members/jfarr/Products/LocalFS/HowTo/DTML_with_LocalFS. -- Loren
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Withers Sent: Friday, April 06, 2001 05:34 To: ÄçìÞôñçò ÁíäñáêÜêçò Cc: zope@zope.org Subject: Re: [Zope] iterating over localfs objects
ÄçìÞôñçò ÁíäñáêÜêçò wrote:
<dtml-in "object-type='localfs'"> <dtml-var sequence-item> </dtml-in>
<dtml-in "objectValues(['LocalFS'])">
...or whatever the Local FS metatype is. jfarr may be able to help...
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Loren wrote:
Check out http://www.zope.org/Members/jfarr/Products/LocalFS/faq and http://www.zope.org/Members/jfarr/Products/LocalFS/HowTo/DTML_with_LocalFS.
Been there, done that, didn't help... thanks anyway. Dimitris @ Nuclear
Are you trying to iterate over the LocalFS objects in a Directory <dtml-in "objectValues(spec='Local File System')"> or the contents of a LocalFS object
Check out http://www.zope.org/Members/jfarr/Products/LocalFS/faq and http://www.zope.org/Members/jfarr/Products/LocalFS/HowTo/DTML_with_LocalFS.
??? --jfarr
Jonathan wrote:
Are you trying to iterate over the LocalFS objects in a Directory
<dtml-in "objectValues(spec='Local File System')">
This one, thank you very much. (and please disregard the personal mail I sent from your zope.org page). Ok, am I in front of a bug ? It turned out that, in one of the many alternative syntaxes I tried, I came up with the right one. But the result was the same --nothing. Trying your version, again no luck. So I started wondering "hey, he actually WROTE it, he can't be wrong !" . So instead of changing the same dtml-doc, I created a new dtml-method. And voila ! It worked ! Puzzled, I tried creating a new dtml-doc and copying the same code... no luck. It only works in methods. Is it the way it's supposed to be ? Or maybe a bug ? Zope 2.2.4 here, served by ZServer on SGI / Irix 5.3 Dimitris @ Nuclear
Dimitris Andrakakis wrote:
Trying your version, again no luck. So I started wondering "hey, he actually WROTE it, he can't be wrong !" . So instead of changing the same dtml-doc, I created a new dtml-method. And voila ! It worked !
Puzzled, I tried creating a new dtml-doc and copying the same code... no luck. It only works in methods.
Is it the way it's supposed to be ? Or maybe a bug ? Zope 2.2.4 here, served by ZServer on SGI / Irix 5.3
This is a FAQ. Methods have the context of their container, Documents have their own context. This means, that in a Document, the code was asking for all the LocalFS objects that the *Document* contains. HTH, Michael Bernstein.
Puzzled, I tried creating a new dtml-doc and copying the same code... no luck. It only works in methods.
Is it the way it's supposed to be ? Or maybe a bug ? Zope 2.2.4 here, served by ZServer on SGI / Irix 5.3
This behavior has nothing to do with LocalFS. It has to do with the behavior of DTML Methods vs. DTML Documents. A DTML Method does not have its own namespace, so it searches the namespace of its containing folder. You are trying to search the DTML Document itself for LocalFS objects, and of course it doesn't contain any. This is a FAQ and I'm sure is covered in the Zope documentation somewhere, although I'd be hard pressed to point you to it (or anything else for that matter). Hope this help clear things up. --jfarr
participants (7)
-
Chris Withers -
Dimitris Andrakakis -
Dimitris Andrakakis -
Jonothan Farr -
Loren Stafford -
Michael R. Bernstein -
Δημήτρης Ανδρακάκης