[Zope-Perl] Send me your Perl Methods

Michel Pelletier michel@digicool.com
Wed, 06 Sep 2000 16:08:05 -0700


Gisle Aas wrote:
> 
> 
> I would actually like to see some methods that interact more with the
> Zope environment.

Hmm.  I agree, can Zope's DOM interface be called effectivly from Perl?

Maybe we could create a cool perl method that worked with the DOM to
display a simple Zope tree, something like:

foo = []
for child in self.getChildNodes():
  if child.getNodeName() == 'Folder':
    foo.append(child.getNodeName())
return foo

The DTML equiv:

<dtml-call "REQUEST.set(foo, [])">
<dtml-in getChildNodes>
  <dtml-if "getNodeName() == 'Folder'")">
    <dtml-call "foo.append(getNodeName())">
  </dtml-if>
</dtml-in>
<dtml-return foo>

Or something like that, this is highly trivialized, but maybe we can
come up with something more interesting, like working it into one of our
application examples and using Perl and some external Perl tool to do
something with the DOM structure of a Zope app.

Any suggestions?


> 
> Regards,
> Gisle