[Zope3-dev] Re: questions about ZConfig and ZCML

Kent Tenney kent at springfed.com
Tue Jul 13 09:56:08 EDT 2004



Philipp von Weitershausen wrote:

> Kent Tenney wrote:
> 
>> I am working on some routines which use PIL to generate
>> images and corresponding html snippets, and
>> am looking at ways to define them with configuration files.
> 
> 
> Define what? Routines?

Define parameters of a fancy frame for photos, images or text block.

<ImageFrame>
   width 50
   outsidecolor #ccffff
   insidecolor #660000
   cornerstyle miter
   size (700, 550)
   style gradient
   content c:\temp\test.png
</ImageFrame>

this generates 4 side images and 4 corner images
which form a frame which blends from outsidecolor
to insidecolor. The html snippet puts the images
into a table, the content is placed in the center cell.

Currently I just create them manually,
Eventually I'd like to be able to generate them dynamically,
based on context.

> 
>> At some point I'd like to port this code to Zope3, which seems
>> all about ZCML.
> 
> 
> and about ZConfig too. The server components, as you already dug up 
> using google, are configured through ZConfig, much like in Zope 2.
> 
> However, the wiring of components which by themselves are only loose 
> objects floating around is done through ZCML.

I've heard that Zope3 will make it easier to use
code which was not written specifically for it.

Is that what you mean by 'loose objects floating around'?

Are there guidelines for how to write the loose objects to
facilitate writing the Interfaces?

--snip--

> A very Zope3ish interpretion of your problem would have the following 
> solution:
> 
> You have several content objects
Is a *content object* Zope3 terminology for code which
returns page content?

> that provide image data, for example 
> described in the interface IPhoto.
Is an *interface* code which is called from the page (ZPT?) and
in turn calls the content object?

> You need to provide HTML snippets for 
> the images, so you have a browser view
Is *browser view* Zope3 terminology?

> for IPhoto objects 
I understand IPhoto, as an Interface, to be sort of
a wrapper around the content object, which I understand
to be what I'm currently working on (ImageFrame).

Is the 'IPhoto object' coming from the content object?

> that renders the HTML snippets.
I guess that answers my question, it sounds like the Interface
is fetching HTML snippets from the content object (ImageFrame)


> You also have a browser view that actually gets 
> called when an IPhoto object is supposed to be presented.
I would expect 'browser view' to be ZPT, the presentation
component of the Zope technologies.

  By looking at
> a request variable, that view might also want to resize the image first. 
> For that, it uses a utility of the kind IImageResizeUtility.
I want to implement PDF version of framed images, which
would be IPDFPhoto ... ?
called by a 'click here for a PDF version of this image' button ... ?

> 
> Something like this has already been implemented in Zope3, a port of the 
> CMFPhoto product. It has not been kept up-to-date, unfortunately, but 
> you can look at the source code in the old CVS repository: 
> http://cvs.zope.org/zopeproducts/photo >
> Most of that code is still valid and especially the ZCML part 
> (configure.zcml)
http://tinyurl.com/4m9zb
OK, this is in the thick of it. It looks like a pretty solid
understanding of the Zope3 architecture is required to make
sense of this.

The Zope3 book looks like the main documentation
http://tinyurl.com/4bbfn, and I guess I should start
with the Glossary.

> might be useful for you to look at. Note that this 
> interpretation makes this problem not so much a question of whether to 
> use ZCML but whether to use the Zope3 Component Architecture or not.
I'm hoping to keep working on my code with an eye to
at some point incorporating it into the Zope3 Component Architecture.

I'm fairly convinced that the smart money is on Zope3.

> I hope that helped,
Indeed

Thanks,
Kent
> 
> Philipp
> 
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: http://mail.zope.org/mailman/options/zope3-dev/kent%40springfed.com
> 
> 




More information about the Zope3-dev mailing list