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

Ondrej Palkovsky xpalo03@vse.cz
Tue, 9 May 2000 15:16:27 +0000 (GMT)


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.