[Zope-CMF] Relating different objects to each other

Phil Glaser StillSmallVoice@DirectvInternet.com
Fri, 11 Oct 2002 16:04:05 -0400


Hi,

I am building a site where my client would like to have a "related items"
feature. The idea would be that, for example, when you display a news item,
you would also display a list of other items, from the same or different
object type, that are related to it. So for the news item, the related item
list might include a document, an event, a link, etc., that are thematically
associated with that object.

Is there a way to do this out of the box with CMF?

If not, the way I was thinking of approaching this is as follows: every type
that can be related in this way would have a list property that contains the
ids of items to which it is related. The search catalog would index this
property. When you display the related items for an object, you would do a
catalog search against the object's id in the related items list index. When
you create the relationship between one item and another, you are simply
adding the item's id to the other item's list property.

If this is a sound approach, I'm wondering if the cleanest way of
implementing it would be to implement the list property, and any related
methods, in the object hierarchy above the level of the different
information types. Since the object hierarchy is not documented anywhere,
I'm not sure where the most logical place to do this modification would be,
and welcome any suggestions.

Or, a completely different approach.

Many thanks!



Philip Glaser
Principal and Software Architect
Sustainable Software Solutions, LLC
StillSmallVoice@DirectvInternet.com
www.sustainsoft.com
973-951-9522