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

Jim Fulton jim@zope.com
Mon, 13 Jan 2003 15:03:25 -0500


Shane Hathaway wrote:
> Jim Fulton wrote:
> 
>> Shane Hathaway wrote:
>>

(I walked over to Shane's desk and asked him some questions,
  which informed my responses.)

...

>>> 1) Add metadata to objects following some schema that I define, and 
>>> search based on that metadata.
>>
>>
>>
>> Could you expand on this a bit?  So you mean add meta data to individual
>> objects, all objects, or "classes" of objects, this creating new content
>> types.
>>
>> Are you basically talking about creating content types here, or about 
>> something
>> simpler.
> 
> 
> I maintain a growing collection of family photographs.  I'd like to set 
> up metadata fields for all of my photographs, such as "date", 
> "location", "subjects" (the names of the people in the photo), and 
> "processing" (what I did to the photo before posting, such as cropping, 
> resizing, adjusting color, etc.).  I don't want Dublin Core metadata. 
> Not all image objects on the site are photographs, so I'd like to just 
> label which of the image objects are photos.  I'd like to be able to add 
> metadata fields later on when I think of them, without writing any 
> software.

So, you do want a content type for pictures. You'd like to derive
this content type from images. Hm, I wonder if you really do. Maybe.

> I believe Zope 3 is close to addressing this use case, but it needs a 
> "metadata" service that allows me to set up metadata schemas.

Maybe. Or maybe, this is data not meta data and all you need is a way
of easily defining new content types by defining a simpler schema.

>>> 2) Define what people see if they traverse directly to the object. 
>>> Although the default view could be defined by the type of the object, 
>>> I think the default view of something is not necessarily dependent on 
>>> its type.
>>
>>
>>
>> I'm confused here. What does the default view depend on? Are you talking
>> about doing this on an object-by-object basis (e.g. folder) or are 
>> talking
>> about defining content types and saying how to display each content type?
> 
> 
> My hathaway.freezope.org site has a little bug I noticed yesterday. 
> There are five folders with separate photos, and if you try to directly 
> visit any of the photo folders, instead of seeing photos, you'll see the 
> listing of all photo folders.  index_html is being acquired.  I can 
> imagine a few ways to fix it:
> 
> 1) Add an index_html to each of the photo folders.  I'd have to remember 
> to do this for all new photo folders as well.
> 
> 2) Change /Photos/index_html to recognize when it has been acquired, and 
> show the photos instead of the photo folder listing.  This makes 
> /Photos/index_html kind of complicated.
> 
> 3) Add a "Photo Folder" content type and use it for all photo folders. 
> This seems heavy, since photo folders exist only for categorization, not 
> to add any functionality to the site.
> 
> 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.


As far as the folder display, you'd like all of the folders containing
pictures to display the pictures as images.  Because you want to affect many
objects, you'd create a new default view for folders that displayed pictures inline
and displayed other objects as links in folder listings. You might be able to
do this with a template alone. You'd register this page as the default view
in your site (or in some sub-site of your site).

> It could be that explicit acquisition will change my perspective, since 
> index_html will not be acquired by default in Zope 3.  So I guess my 
> real question is how Zope 3 will choose the default view for a folder, 
> and how web developers influence that decision.

The default view for all folders is controlled through configuration.
The default view that comes out of the box checks to see if a folder has
an index.html item. If it does, it displays that, otherwise, it displayes
a simpler folder listing.

You can override the default view using your own template.  You would do
that the following way. In the default package of your site:

- Add a template that provides the desired view.

- Add a page configuration that configures the template as
   the default view for folders.

Jim

-- 
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