[ZDP] Help wanted

Howard Clinton Shaw III shawh@sths.org
Thu, 20 May 1999 15:00:02 -0500

On Thu, 20 May 1999, Tom Deprez wrote:
> Hi,
> I re-ask a q'n which I asked earlier. I really need your advice on this! A
> sort of tutorial which can become handy one day.
> Assume a company wants to create a small knowledge-base. The knowledge base
> will contain items which contain : the name of the contributor, email
> address, topic, title and comments.
> The knowledge base should be searchable, viewable in a hierarchy tree. Users
> should be able to add and delete, change items, preferable through a html
> menu :  ie. a searched or selected item can be deleted or changed. If a user
> wants to add an item, he should be able to select in which topic he want to
> place the item or he can create a new topic. (to a newly added topic the
> user can say under which topic it has to reside)
> Can somebody tell me how I would start on this? Is creating a ZClass for the
> items a good idea? Or should a use a SQL-database to store the items in?
> How would you handle the other problem (ie. managing the knowledge tree
> trough a html menu, not Zope itself). Is it possible to delete, change, add
> an object to Zope with a certain link?
> Martijn, can you give some hints (examples?) how you would do this through
> Zope?

Well, I was waiting for someone with experience with ZClasses to answer, but I
didn't see anything. I personally, having never seen ZClasses, would do this in
SQL, creating at least two tables, one for items, and one for the hierarchy.
The easiest way to do a hierarchy in SQL is to have a table with fields ID,
Desc, ParentID. Then you iterate, in your code, over the hierarchy by having an
SQL query like
select * from hier where ParentID=<!--#sqlvar parent type=int-->
and another query like
select * from items where ParentID=<!--#sqlvar parent type=int-->
Have each top-level item point to ID -1 or 0, then call select with that...
<!--#in "parents_sql(parent=0)"-->
 <!--#var sublevels-->

Have another document (sublevels) that contains something like
<!--#with REQUEST-->
 <!--#in "parents_sql(parent=ParentID)"-->
  Do Something
  <!--#var sublevels--> # recurse
 <!--#in "chilluns_sql(parent=ParentID)"-->
  Do Something "Completely Different" (tm)

All the editing can be done with forms calling SQL queries.
> Tom.
> _______________________________________________
> ZDP maillist  -  ZDP@zope.org
> http://www.zope.org/mailman/listinfo/zdp
Howard Clinton Shaw III - Grum
St. Thomas High School
#include "disclaimer.h"