[Zope] Linking two entries in the KnowledgeKit product

Jochen Knuth jok-zope@ipro.de
Fri, 19 Nov 1999 15:50:00 +0100


Hi,

after some playing with Zope i now have to implement my first project, a
knowledge base.

It is a variation of The KnowledgeKit Product from Bill Anderson (a very
good starting point).

One change i made to the KBEntry ZClass property sheet 'properties' is
using the Notes property as a field for adding links to other
KnowledgeBaseEntries (i changed it to type 'lines').
I enter the 'id' of another KnowledgeBaseEntry and in the index_html
method of the KBEntry i included the following snippet to create an link
to this KnowledgeBaseEntry.

-----------KBEntry, index_html ---------------
<dtml-if Notes>
<tr><td VALIGN="TOP">
 <p> <b>Siehe auch:</b>
 </td><td>
 <dtml-in Notes>
  <dtml-if sequence-item>
  <dtml-let num=sequence-item>
  <dtml-in "kbCatalog(meta_type='Knowledge Base Entry',id=num)">
   <a href='/<dtml-var "kbCatalog.getpath(data_record_id_)">'>
   <dtml-if title><dtml-var title></a><br></dtml-if>
  </dtml-in>
  </dtml-let>
  </dtml-if>
 </dtml-in>
</td></tr>
</dtml-if>
------------------------

kbCatalog is a ZCatalog on all Knowledge Base Entries.

This is working well, but there is another requirement to implement. If
i add a "link id" in one Knowledge Base Entry it should automagically
appear as a backlink in the Notes property of the linked Knowledge Base
Entry. And of course if i delete a "link id" it should delete the
backlink.

Any ideas how  i can add this to a KBEntry_change method?

Jochen