[Zope3-dev] IMPORTANT RFS: Through the Web Site Development

Steve Alexander steve@cat-box.net
Wed, 15 Jan 2003 18:55:32 +0200


Shane wrote:
> 4) Visit each folder under /Photos and say that its default view is not 
> index_html but instead photos_view.  This is the solution that I'd 
> prefer, if only because it seems the most obvious.

Leonardo wrote:
> And this could be automated, by copying a folder with this setting,
> instead of creating a new Folder, next time you needed a new Photo
> "folder" (this kind of automation could also be applied to 1). By
> creating the "canonical" Photo folder with the photos_view setting you'd
> be creating a Prototype. 

In Zope 3, views a separate from content.
So, Shane could just walk up to each Folder instance, and mark it with a 
"photo folder content type" marker interface, such as IPhotoFolder.

Then, Shane could override the views for these folders, by choosing 
which of the IFolder views he no longer requires, and rewriting those, 
and perhaps writing some more. Shanes folders would still be IFolder 
instances, but would also be IPhotoFolder instances.

If Shane is going to be making a lot of Photo Folders, then he can set 
up a local factory for PhotoFolders, and configure this to appear in the 
TTW "add stuff" list.

The local factory would do the same thing as the regular Folder factory, 
except that it would add this IPhotoFolder marker interfaces to each 
instance, just before giving the instance to whoever called the factory.


Prototypes may have other uses, but I don't think they are necessary for 
customising objects in this way.

--
Steve Alexander