<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=720133416-31052007><FONT face=Arial
color=#0000ff size=2>You know I had considered using JS for dealing with this.
It does make it much easier to change the CSS on your links to indicate current
page and such. I might look into this again. Thanks!</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
zope-bounces+programmer=paradigm-corp.com@zope.org
[mailto:zope-bounces+programmer=paradigm-corp.com@zope.org] <B>On Behalf Of
</B>SpiderX<BR><B>Sent:</B> Thursday, May 31, 2007 11:25 AM<BR><B>To:</B>
zope@zope.org<BR><B>Subject:</B> Re: [Zope] a batch of
inSaNitY!<BR></FONT><BR></DIV>
<DIV></DIV>I just use Adobe Labs Spry Framework... this effectively puts the
paging in javascript.<BR><BR>
<DIV><SPAN class=gmail_quote>On 5/31/07, <B
class=gmail_sendername>Programmer</B> <<A
href="mailto:programmer@paradigm-corp.com"> programmer@paradigm-corp.com</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi
Jonathan,<BR><BR>I have something similar to your idea already. The python
script <BR>supplies page number to a stored procedure which handles the
actual<BR>paging. The script takes the result from the proc and builds an
html<BR>table and handles column sorting on the table. The output of the
script<BR>is just a single variable so I can just use &dtml-var instead of
the<BR>flaky &dtml-in.<BR>Problem I have now is this new search interface
makes use of full-text<BR>searching on SQL Server 2K. The paging proc wasn't
written to handle it <BR>and will need to be rewritten from scratch. This will
take a lot of time<BR>and testing. I thought I could slap something simple and
fast together<BR>to use in the interim to allow people to start testing the
search<BR>engine.<BR><BR>I really do wish Zope would either fix or eliminate
broken features. At<BR>the very least have the curtesy to say "hey y'all, this
is broke, don't<BR>bother" so folks don't waste time with it.
<BR><BR>Mike<BR><BR>-----Original Message-----<BR>From: Jonathan [mailto:<A
href="mailto:dev101@magma.ca">dev101@magma.ca</A>]<BR>Sent: Wednesday, May 30,
2007 5:22 PM<BR>To: Programmer; <A href="mailto:zope@zope.org">zope@zope.org
</A><BR>Subject: Re: [Zope] a batch of inSaNitY!<BR><BR><BR>----- Original
Message -----<BR>From: "Programmer" <<A
href="mailto:programmer@paradigm-corp.com">programmer@paradigm-corp.com</A>><BR>To:
<<A href="mailto:zope@zope.org"> zope@zope.org</A>><BR>Sent: Wednesday,
May 30, 2007 4:44 PM<BR>Subject: [Zope] a batch of inSaNitY!<BR><BR><BR>>
Hi<BR>><BR>> I am about to go stark, raving, frothing mad with the
DTML-IN<BR>batching.<BR>> Is there a known (or unknown) bug with this?
<BR>><BR>> I have searched and read everything I can find about this and
no luck.<BR>> The problem is with carrying the query terms over from one
batch page<BR>to<BR>> the next. Right now I am using the script found here:
<BR>><BR><A
href="http://mail.zope.org/pipermail/zope-collector-monitor/2003-May/002001.ht">http://mail.zope.org/pipermail/zope-collector-monitor/2003-May/002001.ht</A><BR>>
ml<BR>><BR>> Except I changed,<BR>> <BR>>
<dtml-let<BR>> batch="_.range(100,
180)"<BR>> batch_size="10"<BR>> batch_start="REQUEST.get('batch_start',1)"><BR>><BR>>
To<BR>><BR>> <dtml-let
<BR>> batch="myZSQLMethod1"<BR>> batch_size="10"<BR>> batch_start="REQUEST.get('batch_start',1)"><BR>><BR>>
The mySQLMethod1 takes two params which the search form supplies to <BR>>
REQUEST. This works great. The pagination works beautifully. However,<BR>>
when I use the very same result script with myZSQLMethod2 (same DB<BR>>
table), which takes 5 params (all optional) the pagination breaks and <BR>>
no-longer passes the query terms.<BR>> I have checked and rechecked both
scripts and both forms. The<BR>> ZSQLMethods both test good. I am out of
ideas. For the life of me I<BR>> cannot figure out why I'm losing my query
terms in one and not the <BR>other<BR>> when the two are almost
identical.<BR>> Care to enlighten me with your collective wisdom?<BR><BR>In
similar situations I have done the following:<BR><BR>1) call a python
script/external method which: (i) does the db search; <BR>(ii)<BR>formats the
results as required for display; (iii) returns a tuple that<BR>contains: list
of search results, url parameters for 'previous' link;<BR>url<BR>parameters
for 'next' link; url parameters for 'first link'; url <BR>parameters<BR>for
'last' link<BR><BR>2) use a dtml method to call the script/ext.method
like<BR><BR><dtml-let rStat="mySearchRoutine(parm1, parm1,
...)"><BR><BR> <dtml-in "rStat[0]">
<BR> display code here
eg. <dtml-var
sequence-item><br><BR> or could be
an html/css table, etc.<BR><BR> <dtml-if
sequence-end><BR> <a
href="...?<dtml-var "rStat[1]">">previous</a>
<BR> <a
href="...?<dtml-var
"rStat[2]">">next</a><BR>
<a href="...?<dtml-var
"rStat[3]">">first</a><BR>
<a href="...?<dtml-var "rStat[4]">">last</a>
<BR> </dtml-if><BR><BR> </dtml-in><BR></dtml-let><BR><BR>This
greatly simplifies the dtml and facilitates debugging and
future<BR>modifications.<BR><BR>hth<BR><BR>Jonathan<BR><BR>_______________________________________________
<BR>Zope maillist - <A
href="mailto:Zope@zope.org">Zope@zope.org</A><BR><A
href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</A><BR>**
No cross posts or HTML encoding! **<BR>(Related lists -<BR><A
href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</A><BR><A
href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</A>)<BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Thanks,<BR>Derek Wilson
</BODY></HTML>