[Zope] Puzzled re ZCatalog and Zope.org /SiteIndex

Jeff Rush Jeff Rush" <jrush@timecastle.net
Wed, 03 Nov 99 10:21:34 -0500


On Wed, 3 Nov 1999 08:16:23 -0500, Mike Pelletier wrote:

>Jeff Rush <jrush@timecastle.net> travelled for many days to ask:
>>
>> [1] Some areas I'm having trouble on are the metadata and index fields
>> used in DTML that accesses the SiteIndex zcatalog object.  They use
>> search fields like 'date', 'url', 'title_or_id' and 'text_content' which
>don't
>> exist in a default zcatalog instance.  I can add them via the management
>> interface and re-catalog the site but nothing ever shows up in those
>> index fields.  Is Zope.org using some pluggable-brain technology to
>> wrap a zcatalog and provide these attributes on normal, unchanged
>> objects like DTML Documents and DTML Methods?
>
>    No, it is a completely plain-jane ZCatalog.  Those are external methods.
>In the cases of the Z Classes, they are members of the class.  Vanilla Zope
>objects like DTML Documents are acquiring those methods from a parent
>folder.

Hmmm, I don't quite understand.  Are you saying that ya'll created and
placed in the root folder, say, an external method named 'date' that does
the equivalent of the following in a DTML Method

     <dtml-return bobobase_modification_time>

And then you added a field called 'date' to the ZCatalog metadata
and index tabs?

This seems to work here with a DTML Method -- why was an external
method necessary?  Also doesn't this mean that the ZCatalog instance
is duplicating data, storing the date under both the 'bobobase_modification_time'
(for backward compatibility) and 'date' columns?  This seems like a bit
of overhead just to be able to use the shorter name in search DTML,
or am I missing the benefit/intent?

{also to construct the 'url' attribute, how did you obtain the url of an arbitrary
 object -- the generic Zope equivalent of "getpath(record_id)"?}

-Jeff Rush