[Zope] Tree tag

Pedro Silva Pedro Silva" <pedro.silva@ruido-visual.pt
Mon, 14 Feb 2000 16:24:51 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_000A_01BF7708.04BCF7C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I'm trying to use a dtml tree tag with an External Method, but it isn't =
working.
The code that I'm using is:

    <dtml-in obj_fs>       -> this is the external Method
        <dtml-tree branches_expr=3D"objectValues(['Folder','External =
Method'])" assume_children=3D1>
            <dtml-var sequence-item>
        </dtml-tree>
    </dtml-in>

    And the code in obj_fs is:
        def obj_fs(self):
            import os, os.path
            lst=3Dos.listdir("/var/spool/news/articles")
            return lst

What I'm trying with this, is that the zope programme go get me the =
folders in the directory "/var/spool/news/articles", show those folders =
and with the tree, it will appear a plus sign that when we click on this =
plus sign, it will display the subfolders in the folder that we have =
clicked.
The result must be like the Windows Explorer, with folder and =
subfolders.=20

Is the tree tag compatible with the External Method? If yes, this is not =
working. Can anyone help me to figure where is the error and tell me =
another way to can make this result?

Please send your answers to: psilva@ruido-visual.pt

Thanks,

Pedro

------=_NextPart_000_000A_01BF7708.04BCF7C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Hi,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I'm trying to use a dtml tree tag =
with an=20
External Method, but it isn't working.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>The code that I'm using =
is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &lt;dtml-in=20
obj_fs&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; this is the =
external=20
Method</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&lt;dtml-tree branches_expr=3D"objectValues(['Folder','External =
Method'])"=20
assume_children=3D1&gt;</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; &lt;dtml-var sequence-item&gt;</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&lt;/dtml-tree&gt;</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; =
&lt;/dtml-in&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; And the code in =
obj_fs=20
is:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
def=20
obj_fs(self):</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; import os, os.path</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; =
lst=3Dos.listdir("/var/spool/news/articles")</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; return lst</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>What I'm trying with this, is that =
the zope=20
programme go get me the folders in the directory =
"/var/spool/news/articles",=20
show those folders and with the tree, it will appear a plus sign that =
when we=20
click on this plus sign, it will display the subfolders in the folder =
that we=20
have clicked.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>The result must be like the Windows =
Explorer,=20
with folder and subfolders. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Is the tree tag compatible with the =
External=20
Method? If yes, this is not working. Can anyone help me to figure where =
is the=20
error and tell me another way to can make this result?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Please send your answers to: <A=20
href=3D"mailto:psilva@ruido-visual.pt">psilva@ruido-visual.pt</A></FONT><=
/DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Thanks,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Pedro</FONT></DIV></BODY></HTML>

------=_NextPart_000_000A_01BF7708.04BCF7C0--