[Zope-PTK] Flexible object placement

Kevin Dangoor kid@kendermedia.com
Wed, 1 Mar 2000 12:47:35 -0500


    There was some discussion a few days back about where to put messages
for ZDiscussions in the portal. I have been working on KM|net News 1.1 over
the past few days and I've started thinking a little bit about object
placement for it when I migrate to the PTK.

    It seems to me that for certain types of objects it may be nice for the
site administrator to choose where they want the objects placed. Currently,
KMNN places articles in a central place (organized into folders of
Year/Month/Article). Some people might want articles to live with the member
that submitted them. I have another application in mind where I would like
the articles to live in a central place related to some other objects (not
year/month).

    One can argue that the Catalog makes it so that it does not really
matter where the object is stored. However, I think it does matter somewhat,
because Zope does not have a property type that is a reference to another
object. Take the last case above. Let's say that I want articles related to
a particular music CD to be listed on that CD's page. If the articles live
within the CD object, then it's trivial (<dtml-in
"objectValues('Article')">). But, what if they live in the Member's folder?
You'll need to come up with a referencing scheme so that you can do a
catalog lookup to retrieve the articles for that CD.

    It might be nice if we come up with a standardized hook to decide where
to put the objects when they are added. Maybe they would go somewhere in the
user's folder UNLESS this hook method is defined, and that method would
return the object that should contain the new object.

    Thoughts on this?

Kevin