[Zope] REQUEST

D. Rick Anderson ruger@comnett.net
Wed, 22 May 2002 10:54:35 -0700


--------------090100080901030807070403
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

This is actually a way to track errors. We have a site that has a HUGE 
gambit of forms that people have to go through to apply for a loan. I've 
caught every kind of error that we can think of, and then some, but I 
still have it all being caught in a <dtml-try> with the except going to 
an error page. We're going to have all the people on our floor (100 or 
so) hit the site and try to break something. What I want is to have the 
<dtml-except> send them to a page that records the current REQUEST 
somewhere on the server so I can see what information they sent that 
broke it. Does that make sense? It would also be nice to have this 
information when the site goes live. That way I can see if somebody out 
there in the real world came up with some other way to mess things up 
(and I'm sure they will.)

Anwho .. the lines listed below work great if you put ANYTHING in there 
other than REQUEST. They even work if you put single quotes around 
REQUEST. It just creates the dtml document with the date as the name and 
sticks the work 'REQUEST' in it. How can I actually get the current 
REQUEST information into something? Our first atempt was to insert it 
into a table on the Oracle server, but that failed with similar results.

Thanks again,

Rick


Charlie Reiman wrote:

>It looks to me like you have several problems:
>
>1) manage_addDTMLDocument appears to be legacy code.
>2) newname is a dtml var, not a python var (this might be okay though)
>3) REQUEST is not a string
>4) manage_addDocument doesn't take the document body anyway.
>5) This is a really complicated way to try and track requests. Why not
>append them to a file or display them directy in the the page?
>
>You need something like:
>
><dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))">
><dtml-call "manage_addDocument(_['newname'],'')">
><dtml-call "manage_edit(str(REQUEST),'')">
>
>The last line doesn't work, of course, as I don't know how to get the added
>document. I'm a newbie...
>
>  
>
>>-----Original Message-----
>>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of D.
>>Rick Anderson
>>Sent: Wednesday, May 22, 2002 9:06 AM
>>To: zope@zope.org
>>Subject: Re: [Zope] REQUEST
>>
>>
>>oops. The one I'm using doesn't have quotes around REQUEST:
>>
>><dtml-call "REQUEST.set('newname',
>>ZopeTime().strftime('%m-%d-%Y-%H-%M'))">
>><dtml-call "manage_addDTMLDocument(newname, 'Error', REQUEST)">
>>
>>Rick
>>
>>D. Rick Anderson wrote:
>>
>>    
>>
>>>I'm trying to insert the REQUEST object into a new DTML document to
>>>record errors on a page. It doesn't seem to like the way I'm doing it
>>>and I can't figure out how to get it to work.
>>>
>>>I tried:
>>>
>>><dtml-call "REQUEST.set('newname',
>>>ZopeTime().strftime('%m-%d-%Y-%H-%M'))">
>>><dtml-call "manage_addDTMLDocument(newname, 'Error', 'REQUEST')">
>>>
>>>and I get a Key Error:
>>>
>>>Error Type: KeyError
>>>Error Value: read
>>>
>>>I've tried creating the document first, and then using manage_edit to
>>>insert it, and the same thing happens. I really need to dump the
>>>REQUEST object somewhere when there's been an error so I can see what
>>>happened.
>>>
>>>TIA
>>>
>>>Rick
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>Zope maillist  -  Zope@zope.org
>>>http://lists.zope.org/mailman/listinfo/zope
>>>**   No cross posts or HTML encoding!  **
>>>(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
>>>http://lists.zope.org/mailman/listinfo/zope-dev )
>>>
>>>      
>>>
>>
>>
>>_______________________________________________
>>Zope maillist  -  Zope@zope.org
>>http://lists.zope.org/mailman/listinfo/zope
>>**   No cross posts or HTML encoding!  **
>>(Related lists -
>> http://lists.zope.org/mailman/listinfo/zope-announce
>> http://lists.zope.org/mailman/listinfo/zope-dev )
>>
>>    
>>
>
>
>  
>



--------------090100080901030807070403
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
This is actually a way to track errors. We have a site that has a HUGE gambit
of forms that people have to go through to apply for a loan. I've caught
every kind of error that we can think of, and then some, but I still have
it all being caught in a &lt;dtml-try&gt; with the except going to an error
page. We're going to have all the people on our floor (100 or so) hit the
site and try to break something. What I want is to have the &lt;dtml-except&gt;
send them to a page that records the current REQUEST somewhere on the server
so I can see what information they sent that broke it. Does that make sense?
It would also be nice to have this information when the site goes live. That
way I can see if somebody out there in the real world came up with some other
way to mess things up (and I'm sure they will.)<br>
<br>
Anwho .. the lines listed below work great if you put ANYTHING in there other
than REQUEST. They even work if you put single quotes around REQUEST. It
just creates the dtml document with the date as the name and sticks the work
'REQUEST' in it. How can I actually get the current REQUEST information into
something? Our first atempt was to insert it into a table on the Oracle server,
but that failed with similar results.<br>
<br>
Thanks again,<br>
<br>
Rick<br>
<br>
<br>
Charlie Reiman wrote:<br>
<blockquote type="cite"
 cite="midMHEAKIEGCFLDLMBODHDKKELECAAA.creiman@kefta.com">
  <pre wrap="">It looks to me like you have several problems:

1) manage_addDTMLDocument appears to be legacy code.
2) newname is a dtml var, not a python var (this might be okay though)
3) REQUEST is not a string
4) manage_addDocument doesn't take the document body anyway.
5) This is a really complicated way to try and track requests. Why not
append them to a file or display them directy in the the page?

You need something like:

&lt;dtml-call "REQUEST.set('newname', ZopeTime().strftime('%m-%d-%Y-%H-%M'))"&gt;
&lt;dtml-call "manage_addDocument(_['newname'],'')"&gt;
&lt;dtml-call "manage_edit(str(REQUEST),'')"&gt;

The last line doesn't work, of course, as I don't know how to get the added
document. I'm a newbie...

  </pre>
  <blockquote type="cite">
    <pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:zope-admin@zope.org">zope-admin@zope.org</a> [<a class="moz-txt-link-freetext" href="mailto:zope-admin@zope.org">mailto:zope-admin@zope.org</a>]On Behalf Of D.
Rick Anderson
Sent: Wednesday, May 22, 2002 9:06 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:zope@zope.org">zope@zope.org</a>
Subject: Re: [Zope] REQUEST


oops. The one I'm using doesn't have quotes around REQUEST:

&lt;dtml-call "REQUEST.set('newname',
ZopeTime().strftime('%m-%d-%Y-%H-%M'))"&gt;
&lt;dtml-call "manage_addDTMLDocument(newname, 'Error', REQUEST)"&gt;

Rick

D. Rick Anderson wrote:

    </pre>
    <blockquote type="cite">
      <pre wrap="">I'm trying to insert the REQUEST object into a new DTML document to
record errors on a page. It doesn't seem to like the way I'm doing it
and I can't figure out how to get it to work.

I tried:

&lt;dtml-call "REQUEST.set('newname',
ZopeTime().strftime('%m-%d-%Y-%H-%M'))"&gt;
&lt;dtml-call "manage_addDTMLDocument(newname, 'Error', 'REQUEST')"&gt;

and I get a Key Error:

Error Type: KeyError
Error Value: read

I've tried creating the document first, and then using manage_edit to
insert it, and the same thing happens. I really need to dump the
REQUEST object somewhere when there's been an error so I can see what
happened.

TIA

Rick




_______________________________________________
Zope maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Zope@zope.org">Zope@zope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope">http://lists.zope.org/mailman/listinfo/zope</a>
**   No cross posts or HTML encoding!  **
(Related lists - <a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope-announce">http://lists.zope.org/mailman/listinfo/zope-announce</a>
<a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope-dev">http://lists.zope.org/mailman/listinfo/zope-dev</a> )

      </pre>
    </blockquote>
    <pre wrap="">


_______________________________________________
Zope maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Zope@zope.org">Zope@zope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope">http://lists.zope.org/mailman/listinfo/zope</a>
**   No cross posts or HTML encoding!  **
(Related lists -
 <a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope-announce">http://lists.zope.org/mailman/listinfo/zope-announce</a>
 <a class="moz-txt-link-freetext" href="http://lists.zope.org/mailman/listinfo/zope-dev">http://lists.zope.org/mailman/listinfo/zope-dev</a> )

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
<br>
</body>
</html>

--------------090100080901030807070403--