[Zope-dev] urg

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Tue, 07 Mar 2000 15:33:11 +0100


>> Ah yes, but I thought not to catalog KBFolders. They are merely the class
>> which shows the KBItems in a way you want. Assume this: you've the
>> following Knowledgebase Tree :
>> 
>> Python
>> Zope
>>   What is Zope?
>>   Problem 1
>>   Python
>>   DTML
>>     What is DTML?
>>    ...
>> 
>> Then this would be
>> 
>> Python (KBFolder)
>> Zope (KBFolder)
>>   What is Zope? (KBItem; Categorie: ZOPE)
>>   Problem 1 (KBItem; Categorie: ZOPE)
>>   Python (KBFolder)
>>   DTML (KBFolder)
>>     What is DTML? (KBItem; Categorie ZOPE DTML)
>> 
>> Now:
>> 
>> searching for DTML will return: 'What is DTML?'
>> searching for ZOPE will return: 'What is ZOPE?', 'Problem1', 'What is
DTML?'
>> 
>
>OK, this is clear.
>This could be (partially) resolved with my proposal:
>
><dtml-in "ZOPE.objectValues(['KBFolder', 'KBItem])">
>   <dtml-if "_['sequence-item'].meta_type=='KBFolder'">
>       <dtml-in "_.sequence-item.objectValues(['KBItem'])>
>            <dtml-var sequence-item>
>       </dtml-in>
>   <dtml-else>
>       <dtml-var sequence-item>
>   </dtml-if>
></dtml-in>
>
>[notes: 
>this is only to give the idea. It is not tested.
>1. It would need some elaboration for more than 1 item deep (by
>factoring out the dtml-if, for example
>2. Though I did not try this, I'm sure you could also do this with
>KBFolders returned from a Catalog]
>
>Rik


Hi Rik,

Ok, this is already the implementation of the folder. But how can we fill
in the category property? eg. the KBItem 'What is DTML?' has it's category
property filled with the strings 'ZOPE' and 'DTML'. These strings are the
KBFolders 'ZOPE' and 'DTML'. 

Ok, it's no problem to get the correct strings when adding a KBItem. But
what when you move the KBItem? eg. to folder 'Python'. Then the category
property should contain 'ZOPE' and 'PYTHON'...

Do you see the problem?

Tom.