[Zope] dtml-tree stuff

Mike Kelland mike@studiomatic.com
Thu, 30 Nov 2000 10:12:00 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0019_01C05AB5.FA655820
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think I may not have asked a specific enough question last time round. =
 I'll try it again.  I've been looking through the How-To's and the =
documentation and the dtml-tree stuff that I have found seems =
exceedingly cryptic.  The closest that I've come to a solution is the =
following code:

<dtml-in "getAllClientNames(REQUEST)">
<dtml-tree id=3DclientID =
branches_expr=3D"getClientsForProjects(get_clientID=3DclientID)" >
<dtml-var company_name>
</dtml-tree>
</dtml-in>

where=20

getAllClientNames looks like:

select company_name,clientID from client;

and getClientsForProjects looks like:

select company_name, clientID from client where deleted =3D 0 and =
clientID =3D <dtml-sqlvar get_clientID type=3Dint>;

This gives me a tree structure which, when I expand company1 gives me =
company1 again and again=20

(ie=20

Company1
        Company1
                  Company1
                        Company1
                                  etc as deep as I care to go
Company2
        Company2
                etc
Company3
Company4

What I'm trying to do is list my company name as the tree branch and =
have the sub headings of each branch be my projects for that company.  =
Can anyone help?

Thanks very much

Mike Kelland
mike@studiomatic.com=20

------=_NextPart_000_0019_01C05AB5.FA655820
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I think I may not have asked a specific =
enough=20
question last time round.&nbsp; I'll try it again.&nbsp; I've been =
looking=20
through the How-To's and the documentation and the dtml-tree stuff that =
I have=20
found seems exceedingly cryptic.&nbsp; The closest that I've come to a =
solution=20
is the following code:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-in=20
"getAllClientNames(REQUEST)"&gt;<BR>&lt;dtml-tree id=3DclientID=20
branches_expr=3D"getClientsForProjects(get_clientID=3DclientID)"=20
&gt;<BR>&lt;dtml-var=20
company_name&gt;<BR>&lt;/dtml-tree&gt;<BR>&lt;/dtml-in&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>where </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>getAllClientNames looks =
like:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>select company_name,clientID from=20
client;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and getClientsForProjects looks =
like:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>select company_name, clientID from =
client where=20
deleted =3D 0 and clientID =3D &lt;dtml-sqlvar get_clientID=20
type=3Dint&gt;;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This gives me a tree structure which, =
when I expand=20
company1 gives me company1 again and again </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>(ie </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Company1</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Company1</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Company1</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Company1</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
etc as deep as I care to go</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Company2</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Company2</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
etc</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Company3</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Company4</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What I'm trying to do is list my =
company name as=20
the tree branch and have the sub headings of each branch be my projects =
for that=20
company.&nbsp; Can anyone help?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks very much</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Mike Kelland</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"mailto:mike@studiomatic.com">mike@studiomatic.com</A>=20
</FONT></DIV></BODY></HTML>

------=_NextPart_000_0019_01C05AB5.FA655820--