Mailing List Archive

[Zope-PTK] Flexible object placement
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
Re: [Zope-PTK] Flexible object placement [ In reply to ]
On Wed, 1 Mar 2000, Kevin Dangoor wrote:

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

[snip]

> One can argue that the Catalog makes it so that it does not really
> matter where the object is stored.

At least, from the PTK's point of view, it doesn't matter. I agree
that there may well be other points of view from which it _does_
matter. So, I am all for designing PTK discussions such that they don't
care where the live, and allow the administrator to make (or not
make) the decision of where to put them in policy.

> However, I think it does matter somewhat, because Zope does not have a
> property type that is a reference to another object.

There is a way. ZCatalog results contain a kind of a reference to a
Zope object: it's path. This is a touch cheesy since it's often
surprisingly difficult to transform a path into an object, but it works.

It's also quite possible to stuff a Zope object in an attribute of
another object. I've shied away from doing this because I'm not at all
certain what the ramifications would be.

Mike.

--
Mike Pelletier email: mike@digicool.com
Mild mannered software developer icq: 7127228
by day, super villain by night. phone: 519-884-2434