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

Jim Fulton jim@zope.com
Thu, 16 Jan 2003 15:51:47 -0500


This was a cool point. Somehow, it made me think of "content type"
marker interfaces a different way. Hm... :)

Steve Alexander wrote:
> 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
> 
> 


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org