[Zope] Re: Parameters for external methods and page templates

Andreas Tille tillea@rki.de
Tue, 17 Sep 2002 11:33:49 +0200 (CEST)


On Mon, 16 Sep 2002, Paul Winkler wrote:

> This is very odd; looking at that zopelabs recipe, I don't even
> understand why it works in DTML. The external method
> returns the actual image data, not a URL to an image object.
Yes, that's correct and intended.  I'm creating a dynamical image.  I'm
using a template gif (containing a geographic map - each region with a
different palette entry) and obtain a parameter for each geographic
region from a database and set the color of the region accordingly.
The resulting image is returned and can be viewed inside an <img>-tag.
If you call the URL of the External Method explicitely the browser
just presents the image data as bytes in ASCII-text - but this is no
problem in my opinion.

> What is "argument" in your version?
Well any argument where I want to have influenze on the parameters I
want to obtain from the database.  Just any integer later I will add
one or two strings - perhaps a more complex structure.

> What does "View source" show you when you look at the rendered
> img tag from DTML?
As I said if the External Method "method" is called like

     <img src="method" ...>

the image is displayed as expected.

Kind regards

        Andreas.