[Zope-CMF] printing out member roster grouped by custom property ZPT

Kristina Quimson Buenafe kqb7a@virginia.edu
Wed, 17 Jul 2002 14:24:03 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0BD7_01C22D9D.99FFD1B0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I am trying to print out the members of my CMF site (Zope 2.5.1, Plone =
0.9.9, CMF 1.3beta1) and group them by a custom property.  For example, =
I would like to have a page that looks somewhat like this:

Agency1
-Person1
-Person2
-Person3

Agency2
-Person4
-Person5

Agency3
-Person6

and so on.


While searching the Zope-CMF archives I found this post that addresses =
the sorting issue, but does it with DTML.  Do any of you know how to =
accomplish this by using ZPT? =20

thanks,
Kristina Buenafe



As it turns out, I don't think what I was trying to do was possible.  I =
did
solve the problem however, by modifying the list of dictionaries =
returned
from portal_membership.getRoster() to include the custom properties and =
then
calling dtml-in...

K

-----Original Message-----
From: zope-cmf-admin@NO-SPAM.zope.org =
[mailto:zope-cmf-admin@NO-SPAM.zope.org]On Behalf
Of Kevin Carlson
Sent: Monday, May 06, 2002 5:31 PM
To: zope-cmf group
Subject: [Zope-CMF] Sorting member roster by custom property


Hi,

I have added several custom properties to the portal_memberdata tool and =
can
successfully add new users to the roster.  I would like to be able to
display the roster sorted on a customer property but am having the =
following
problem.

If I use this code:

<dtml-let roster=3D"portal_membership.getRoster()">
<dtml-in roster mapping>
<dtml-let member=3D"portal_membership.getMemberById(id)"
ln=3D"member.getProperty('lastName')" =
fn=3D"member.getProperty('firstName')"
r=3D"member.getRoles()">

things work fine but aren't' sorted.  If I want to sort by lastName or
firstName I cannot specify the property in a "sort=3D" attribute for the
dtml-in tag because it doesn't exist in the returned mapping.

Is it possible to reference an attribute of the memberdata object like =
this
or do I need a custom sort routing to build a list of dictionaries?

Thanks,

Kevin










Kristina Quimson Buenafe
University of Virginia=20
434.244.9760 (home)
434.924.7816 (work)
703.585.8384 (cell)
buenafe@virginia.edu


------=_NextPart_000_0BD7_01C22D9D.99FFD1B0
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 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>I am trying to print out the members =
of my CMF=20
site (Zope 2.5.1, Plone 0.9.9, CMF 1.3beta1) and group them by a custom=20
property.&nbsp; For example, I would like to have a page that looks =
somewhat=20
like this:</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Agency1</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person1</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person2</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person3</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Agency2</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person4</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person5</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Agency3</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>-Person6</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>and so on.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>While searching the Zope-CMF archives =
I found=20
this post that addresses the sorting issue, but does it with DTML.&nbsp; =
Do any=20
of you know how to accomplish this by using ZPT?&nbsp; </FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>Kristina Buenafe</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>As it turns out, I don't think what I =
was trying to=20
do was possible.&nbsp; I did<BR>solve the problem however, by modifying =
the list=20
of dictionaries returned<BR>from portal_membership.getRoster() to =
include the=20
custom properties and then<BR>calling =
dtml-in...<BR><BR>K<BR><BR>-----Original=20
Message-----<BR>From: </FONT><A class=3Darc style=3D"TEXT-DECORATION: =
underline"=20
href=3D"mailto:zope-cmf-admin@NO-SPAM.zope.org"><FONT face=3DArial =
color=3D#000000=20
size=3D2>zope-cmf-admin@NO-SPAM.zope.org</FONT></A><FONT face=3DArial =
size=3D2>=20
[mailto:</FONT><A class=3Darc style=3D"TEXT-DECORATION: underline"=20
href=3D"mailto:zope-cmf-admin@NO-SPAM.zope.org"><FONT face=3DArial =
color=3D#000000=20
size=3D2>zope-cmf-admin@NO-SPAM.zope.org</FONT></A><FONT face=3DArial =
size=3D2>]On=20
Behalf<BR>Of Kevin Carlson<BR>Sent: Monday, May 06, 2002 5:31 PM<BR>To: =
zope-cmf=20
group<BR>Subject: [Zope-CMF] Sorting member roster by custom=20
property<BR><BR><BR>Hi,<BR><BR>I have added several custom properties to =
the=20
portal_memberdata tool and can<BR>successfully add new users to the=20
roster.&nbsp; I would like to be able to<BR>display the roster sorted on =
a=20
customer property but am having the following<BR>problem.<BR><BR>If I =
use this=20
code:<BR><BR>&lt;dtml-let=20
roster=3D"portal_membership.getRoster()"&gt;<BR>&lt;dtml-in roster=20
mapping&gt;<BR>&lt;dtml-let=20
member=3D"portal_membership.getMemberById(id)"<BR>ln=3D"member.getPropert=
y('lastName')"=20
fn=3D"member.getProperty('firstName')"<BR>r=3D"member.getRoles()"&gt;<BR>=
<BR>things=20
work fine but aren't' sorted.&nbsp; If I want to sort by lastName=20
or<BR>firstName I cannot specify the property in a "sort=3D" attribute =
for=20
the<BR>dtml-in tag because it doesn't exist in the returned =
mapping.<BR><BR>Is=20
it possible to reference an attribute of the memberdata object like =
this<BR>or=20
do I need a custom sort routing to build a list of=20
dictionaries?<BR><BR>Thanks,<BR><BR>Kevin<BR><BR><BR><BR><BR></FONT></DIV=
>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DVerdana size=3D2>Kristina Quimson =
Buenafe<BR>University of=20
Virginia <BR>434.244.9760 (home)<BR>434.924.7816 (work)<BR>703.585.8384=20
(cell)<BR><A=20
href=3D"mailto:buenafe@virginia.edu">buenafe@virginia.edu</A><BR></FONT><=
/DIV></BODY></HTML>

------=_NextPart_000_0BD7_01C22D9D.99FFD1B0--