[Zope-dev] ZPatterns Image Archive Project

Michael R. Bernstein webmaven@lvcm.com
Fri, 30 Mar 2001 19:30:29 -0800


"Phillip J. Eby" wrote:
> 
> At 05:27 PM 3/30/01 -0800, Michael R. Bernstein wrote:
> >Now I am working on a ArchiveImage ZClass that holds 'meta'
> >information about an image, such as the description, a date,
> >and keywords.
> >
> >I want to have one Rack for each image size that I want to
> >store.
> 
> Just out of curiousity, why do you want seperate racks for each size?  Are
> they being stored in different ways or have different behavioral
> requirements (e.g. different classes) apart from their size?  If not, there
> is probably no reason to have multiple racks.

Well, I want to store several versions of each image. Let's
take a simplified case where I want the original image and a
thumbnail, both of which need to appear as subobjects of the
ZClass with the meta-data.

If I store all the RackImages (originals and thumbnails) in
one Rack, how do I differentiate between them, so that
'/Archive/001/thumbnail' and 'Archive/001/original' show the
appropriate images? It just seemed simpler to create a
'thumbnail' Rack and an 'original' Rack.

> >I realize that I need to tie the Racks together in the
> >specialist using SkinScripts
> 
> SkinScript doesn't do anything to tie racks together or to a Specialist -
> it's just a way of describing where the data comes from/goes to for a
> particular Rack.

That's what I meant, sorry. The RackImages need to appear to
be attributes of the ZClass, and I'll use SkinScripts to
accomplish that.

> >Where do I put the separate Racks? do I create a specialist
> >for each Rack (seems unneccessary) or do I put several Racks
> >in the same Specialist?
> 
> Several in the same, if they are providing objects which fill the same role
> in your overall application.

And do the RackImages Racks go into the same Specialist as
the ZClass Rack?

> >The DTML I am using to instantiate RackImages in the Rack
> >for example, is as follows:
> >
> ><dtml-let ni="newItem(REQUEST.id)">
> > <dtml-call "ni.manage_edit(REQUEST.title,'')">
> > <dtml-call "ni.manage_upload(REQUEST.file)">
> ></dtml-let>
> >
> >But this code only works for a Rack named defaultRack, which
> >I can obviously only have one of.
> 
> Just use the name of the rack, e.g.:
> 
> <dtml-let ni="rackOne.newItem(REQUEST.id)">, etc.

Ok, thanks! That works (Duh).

Michael Bernstein.