Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Martijn Pieters

On Wed, Jul 12, 2000 at 04:05:08PM +1000, Curtis Maloney wrote:
 On Wed, 12 Jul 2000, Jonathan Desp wrote:
  well if you use that script ? --
 
  meta http-equiv="refresh" content="0
  ;URL=http://www.apple.com/enterprise/"
 
  It will fix your problem ?
 
 I think you've completely missed the point of my post.
 
 Firstly: I don't use those meta tags unless i absolutely have to.  The 
 redirection I have in place works fine, when it gets parsed.
 
 Secondly: My  problem is NOT redirecting the page.
 
 I added the redirect as a debuging tool, to find out if the DTML parser was 
 getting that far.  In case you've not noticed, any time you get an error, 
 that object is not rendered at all, instead the error report is put in its 
 place.
 
 What it showed me was that the page in question was not being parsed at all, 
 even tho the traceback shows it is.

You are seeing transactions at work. Your DTML Method _is_ being processed,
only an exception caused the publishing process to stop, roll back the
transaction, and return the error message to you.

DTML is not a linear language like ASP, it is not processed one line at a time
and bails out at the first error. DTML is parsed into an object tree when
entered, and this tree it then later on asked to render itself. An exception
in this tree will propagate down to the publishing level, and then turned into
an error response. So DTML is, like Python and Java, object oriented and
exception driven.

If you want to see how far a page gets, try using dtml-try blocks around
parts of your code. You can then catch the exception higher in the object
tree, and generate your own messages in reaction to this.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Curtis Maloney

On Wed, 12 Jul 2000, Martijn Pieters wrote:

 You are seeing transactions at work. Your DTML Method _is_ being processed,
 only an exception caused the publishing process to stop, roll back the
 transaction, and return the error message to you.

 DTML is not a linear language like ASP, it is not processed one line at a
 time and bails out at the first error. DTML is parsed into an object tree
 when entered, and this tree it then later on asked to render itself. An
 exception in this tree will propagate down to the publishing level, and
 then turned into an error response. So DTML is, like Python and Java,
 object oriented and exception driven.

 If you want to see how far a page gets, try using dtml-try blocks around
 parts of your code. You can then catch the exception higher in the object
 tree, and generate your own messages in reaction to this.

Fine... so my debuging techniques are less than perfect.  I will change them 
in future. Thanks.

That doesn't change my original problem, which everybody has so far decided 
to ignore.

Curtis.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Martijn Pieters

On Wed, Jul 12, 2000 at 05:00:45PM +1000, Curtis Maloney wrote:
 Fine... so my debuging techniques are less than perfect.  I will change them 
 in future. Thanks.
 
 That doesn't change my original problem, which everybody has so far decided 
 to ignore.

Well, I can't really see what is going wrong, and can only suggest techniques
of honing in on the problem.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Curtis Maloney

On Wed, 12 Jul 2000, Martijn Pieters wrote:
 On Wed, Jul 12, 2000 at 05:00:45PM +1000, Curtis Maloney wrote:
  Fine... so my debuging techniques are less than perfect.  I will change
  them in future. Thanks.
 
  That doesn't change my original problem, which everybody has so far
  decided to ignore.

 Well, I can't really see what is going wrong, and can only suggest
 techniques of honing in on the problem.

At your suggestion, i've wrapped any contentious parts of the 
internal/standard_html_header in a dtml-try, which has had no effect.

Firstly: what would cause Zope to give me that type error?  Too many 
arguments?

I'm not doing anything fancy.  This worked until i changed the standard 
header, which is why i'm digging about in it.

but since the only parts of that now that are not in a try statement are raw 
HTML, how could it go splat?

From what I understand of the traceback, the problem is occurring in the 
header, but it's not clear WHERE, or, tbh, WHY.

Any more help much appreciated.  If you want to see the actual DTML, just ask.

Curtis Maloney.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Martijn Pieters

On Wed, Jul 12, 2000 at 05:14:57PM +1000, Curtis Maloney wrote:
 At your suggestion, i've wrapped any contentious parts of the 
 internal/standard_html_header in a dtml-try, which has had no effect.
 
 Firstly: what would cause Zope to give me that type error?  Too many 
 arguments?
 
 I'm not doing anything fancy.  This worked until i changed the standard 
 header, which is why i'm digging about in it.
 
 but since the only parts of that now that are not in a try statement are raw 
 HTML, how could it go splat?
 
 From what I understand of the traceback, the problem is occurring in the 
 header, but it's not clear WHERE, or, tbh, WHY.

Where _is_ the traceback? It may well be that the call _to_ the header is
botched.

I also see that you are making assumptions about acquisition context. An
acquired message does not autmatically also acquire the context of the caller.
See several articles and How-To's by Jim Fulton and Shane Hathaway on
Zope.org.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Curtis Maloney


Forgot to include:

Zope Error

 Zope has encountered an error while publishing this resource. 

 Error Type: TypeError
 Error Value: too many arguments; expected 2, got 3


Curtis.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Martijn Pieters

On Wed, Jul 12, 2000 at 05:36:26PM +1000, Curtis Maloney wrote:
 The traceback was in my original message.  I will give you a new one this 
 time, since i have managed to move along a _tiny_ ammount, but still get the 
 same error.

Found it now. There were two copies of your message, and I found the one
without the trace.

 
  I also see that you are making assumptions about acquisition context. An
  acquired message does not autmatically also acquire the context of the
  caller. See several articles and How-To's by Jim Fulton and Shane Hathaway
  on Zope.org.
 
 Hmm.. so, if i request http://mysite/internal/register
 and it acquires the DTML Document 'register' from mysite/ into internal
 register won't neccesarily be in the internal/ namespace?
 
 Erm my Zope world is crumbling!  It all seemed so simple before...
 
 Then again, when you can't trust the id, what can you trust? (o8

register will look in internal for objects, but only if it can't find them
first in the mysite (root) object. Read Jim's acquisition algebra texts:

  http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/

So we have:

  mysite/

standard_html_header
register

internal/

  standard_html_header

and you are calling mysite.internal.register, which in turn tries to call
mysite.internal.register.standard_html_header. mysite.internal.register is, in
Jim's algebra: ((register o mysite) o (internal o mysite)), so when register
tries to call standard_html_header, it will go from left to right through this
list, and will find mysite.standard_html_header first.

If this worries you about your view of Zope, you're about to reach your next
level of Zope Zen. =)

   File /usr/local/Zope-2.1.6-src/lib/python/OFS/DTMLMethod.py, line 146, in 
 __call__
 (Object: standard_html_header)
   File /usr/local/Zope-2.1.6-src/lib/python/DocumentTemplate/DT_String.py, 
 line 502, in __call__
 (Object: standard_html_header)
 TypeError: (see above)

The first 3 lines let us know that we are _inside_ an object called
standard_html_header. In your case this will be the on in the root Folder of
your site, I suspect. 

What actually goes wrong I don't know. It _probably_ goes wrong inside the
rendering of this object, but this is masked, I think, by the fact that the
next step on the stack is in render_blocks, which is implemented in C.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio
-

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] RE: Bizarre error with standard_html_header

2000-07-12 Thread Curtis Maloney

On Wed, 12 Jul 2000, Martijn Pieters wrote:
 register will look in internal for objects, but only if it can't find them
 first in the mysite (root) object. Read Jim's acquisition algebra texts:

   http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/

 So we have:

   mysite/

 standard_html_header
 register

 internal/

   standard_html_header

 and you are calling mysite.internal.register, which in turn tries to call
 mysite.internal.register.standard_html_header. mysite.internal.register is,
 in Jim's algebra: ((register o mysite) o (internal o mysite)), so when
 register tries to call standard_html_header, it will go from left to right
 through this list, and will find mysite.standard_html_header first.

I'll go back and read Jims algebra.. sounds like an eminently logical way of 
keeping things in order. (o8

However, there are some problems with what you say.  If it's using 
/standard_html_header, then why did things change (not exactly for the 
better, but changed) when i started messing with 
/internal/standard_html_header ?


 If this worries you about your view of Zope, you're about to reach your
 next level of Zope Zen. =)

Oh, goodie!  Do I get a badge for this one? (o8

File /usr/local/Zope-2.1.6-src/lib/python/OFS/DTMLMethod.py, line 146,
  in __call__
  (Object: standard_html_header)
File
  /usr/local/Zope-2.1.6-src/lib/python/DocumentTemplate/DT_String.py, line
  502, in __call__
  (Object: standard_html_header)
  TypeError: (see above)

 The first 3 lines let us know that we are _inside_ an object called
 standard_html_header. In your case this will be the on in the root Folder
 of your site, I suspect.

Well, yeh.  From reading the traceback, I thought the problem was in 
standard_html_header, too.  So, first I tried to establish WHICH.


 What actually goes wrong I don't know. It _probably_ goes wrong inside the
 rendering of this object, but this is masked, I think, by the fact that the
 next step on the stack is in render_blocks, which is implemented in C.

Well, what still gets me is it complaining of  the wrong number of 
parameters... how can this be?

I think if we can work that out, we'll be a step closer to heaven.

Have a better one,
Curtis.


___
Zope maillist  -  [EMAIL PROTECTED]
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 )