[Zope] Inter version problems & ZCatalog problems (long)

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Tue, 09 May 2000 18:37:14 +0200


Funny, I developed also such a KnowledgeBase,

mine is in the sort of :

kbKnowledgebase
 kbCategory
   kbQuestion
     kbAnswer
     kbAnswer
   kbCategory (thus we can nest Categories)

Now, in an external method, kbCategory looks for it's category-name and all
the category names of its parents. It is this method that is put in a
ZCatalog. By this, searching through the catalog for a certain 'topic'
results in all the kbCategories which contain the 'topic'. The benefit of
the method is also at another point, when moving it from one kbCategory
folder to another, because with the method, the catalog is always
up-to-date. (At least that's what I think, I haven't found the time to test
the system very very roughly)

Tom.

     

At 15:16 09/05/2000 +0000, you wrote:
>I just tried to develop a small system for publishing informations. It has
>the following structure:
>KnowledgeBase folder
>.... kMessage
>.... kMessage
>.... kSearchFolder
>......kMessage
>.... Folder
>......kMessage
>etc.
>Source is available at http://sorry.vse.cz/~xpalo03/kbase.tar.gz
>I have following problems:
>  Adding kMessage into KnowledgeBase structures doesn't work in 2.1.6
>version, but works in 2.1.4 version. I always get Permission denied on
>manage_editProperties. I use following code to found a root folder:
><dtml-in PARENTS skip_unauthorized=1>
>  <dtml-if "meta_type=='KnowledgeBase'">     
>    <dtml-call "REQUEST.set('kBaseId',id)">
>  </dtml-if>
></dtml-in>
><dtml-call "REQUEST.set('kBaseObj',_.getattr(_.this,kBaseId))">  
>
>This suffers from one problem, when thare is a Folder with same name of
>the 'root' folder, but I didn't find another way to do it (any
>suggestions?) This sets the 'kBaseObj' to the topmost 'KnowledgeBase'
>Folder. This code is in constructor of kmessage:
>
><dtml-call "REQUEST.set('kSequence',kSequence+1)">
><dtml-call 
>"kBaseObj.propertysheets.Seqopt.manage_editProperties(REQUEST)">
>
>It doesn't work in 2.1.6 from factory, but works when called from a DTML
>method elsewhere. In 2.1.4. it's ok both in factory & method.
>
>Another problem is with catalog. I wanted to be able to search in
>Subtrees, but didn't find any way how to limit ZCatalog in respect to the
>'path'. I created a ZClass inherited from ZCatalog and I let this thing
>being called from a kMessage constructor:
>   <dtml-call "REQUEST.set('myUrl',this().url())">  
>   <dtml-call "REQUEST.set('myObj',this())">
>   <dtml-in PARENTS>
>     <dtml-if "meta_type=='KnowledgeBase' or meta_type=='kSearchFolder'">
><dtml-try>
>       <dtml-call "uncatalog_object(myUrl)">
><dtml-except>
></dtml-try>
>       <dtml-call "catalog_object(myObj,myUrl)">
>     </dtml-if>
>   </dtml-in>
>This should register this message in all ZCatalog-inherited classes
>upwards. It gets, but in the classes higher then the one the Catalogs gets
>updated somewhat badly. Suppose this structure:
>kbase (KnowledgeBase)
>..folder (kSearchFolder)
>....mesg1
>....mesg2
>Now searching for Title in 'folder' is ok, but from 'kbase' I get no
>result for 'mesg1' and line corresponding to mesg1 for Title='mesg2', for
>other messages it's all this way moved. When I do Update Catalog,
>everything gets fixed. Any suggestions?
>
>Ondrej
>--
>IBM's original motto:
>	Cogito ergo vendo; vendo ergo sum.
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>