Zieve.... one way to sort ZClasses dynamically...
Get it at: http://www.zope.org/Download/Contrib/Zieve.tgz from the README: Zieve 0-0-1 Zieve is a (beta) Z-subclassable class that assists in sorting ZClasses in various ways. To use Zieve... unpack the tgz file in the zope home folder. Then start Zope and create a ZClass with Zieve as a base class. Then put an instance of this ZClass where you can reach it from your folders of other ZClasses. Here is some DTML from a DTMLMethod that uses a zclass derived from Zieve to do some sorting... This displays a table heading with links that dynamically resort the table according to which link was clicked last. The secondary, tertiary, ...etc keys are remembered from prior clicks.... ---------------------------------------------------------------------- <!--#var standard_html_header--> <h2><!--#var title_or_id--></h2> <br> <!-- 'theZieve' is an instance of a ZClass that is subclassed from Zieve. 'name', 'color', 'birthsone', 'number' are all properties of the ZClass. The format 'name:format' allows you to specify a type or filter to use before comparison. --> <!--#in "theZieve.sortObjects( objectValues(['mySortableClass']), REQUEST, RESPONSE, defaultKeys=['name','color','birthstone','number:int'])"--> <!--#if sequence-start--> <center><table> <tr> <td><a href="theZieve/setSortPrimary?key=name">name</a></td> <td><a href="theZieve/setSortPrimary?key=color">color</a></td> <td><a href="theZieve/setSortPrimary?key=birthstone">birthstone</a></td> <td><a href="theZieve/setSortPrimary?key=number:int">number</a></td> </tr> <!--#/if--> <!--#with sequence-item--> <tr> <td><!--#var name--></td> <td><!--#var color--></td> <td><!--#var birthstone--></td> <td><!--#var number--></td> </tr> <!--#/with--> <!--#if sequence-end--> </table></center> <!--#/if--> <!--#else--> Sorry.. there are no objects to sort.. <!--#/in--> <!--#var standard_html_footer--> ---------------------------------------------------------------------- steve@spvi.com
At 06:46 04/08/99 , Steve Spicklemire wrote:
Oops, The file is named .tgz, which suggests it's a tarballed, gzipped archive. It is however only a tarball. Could you either rename it to Zieve.tar, or upload a gzipped version? It would avoid some confusion. Thanx =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Oops! Sorry Martijn! Thanks for noticing ... I've been doing so much 'Z'ope I guess I thought the 'z' in "tar -c(z)f" was implicit. ;-) It's fixed now.... -steve
"Martijn" == Martijn Pieters <mj@antraciet.nl> writes:
Martijn> At 06:46 04/08/99 , Steve Spicklemire wrote: >> Get it at: http://www.zope.org/Download/Contrib/Zieve.tgz Martijn> Oops, Martijn> The file is named .tgz, which suggests it's a tarballed, Martijn> gzipped archive. It is however only a tarball. Could you Martijn> either rename it to Zieve.tar, or upload a gzipped Martijn> version? Martijn> It would avoid some confusion. Thanx =) -- Martijn
participants (2)
-
Martijn Pieters -
Steve Spicklemire