[Zope] ZCatalog Object Identifier

Mark Gibson mark@kaivo.com
Thu, 19 Sep 2002 21:35:49 -0600


Thanks Casey,

I upgraded to Zope 2.5.1 and had the ZClass derive from 
CatalogPathAwareness.  This seems to have fixed the problem.

Mark

Casey Duncan wrote:

> Up until recently the CatalogAware base class for ZClasses was not
> compatible with virtual hosting. There is a new CatalogAware base class
> which alleviates this problem.
> 
> As a workaround, create a simple product that registers the
> Products.ZCatalog.CatalogPathAwareness.CatalogAware as a base class for
> ZClasses (This is available in new Zopes, but not 2.4.x). Then use this base
> class in its place. (Unfortunately this means creating new ZClasses and
> instances or holding onto your butts ;^).
> 
> Alternately you could replace the code from CatalogAwareness module with the
> code in CatalogPathAwareness (or make CatalogAwareness a symlink to
> CatalogPathAwareness). This should work equally well with no class/object
> rebuilding necessary (just do a full clear and reindex). I would do this in
> a test environment first just to make sure nothing breaks.
> 
> hth,
> 
> -Casey
> 
> ----- Original Message -----
> From: "Mark Gibson" <mark@kaivo.com>
> To: <zope@zope.org>
> Sent: Monday, September 16, 2002 2:11 PM
> Subject: [Zope] ZCatalog Object Identifier
> 
> 
> 
>> Using Zope 2.4.4
>> 
>> I have a zope instance that's setup like this:
>> /
>> /Client
>> /Client/company
>> /Client/company/data
>> /Client/company/catalog
>> 
>> 
>> I'm using VirtualHostMonster to allow access to /Client/company through
>> a domain name. (i.e. www.company.com points to /Client/company).
>> 
>> I have set of ZClass objects that get cataloged. If I submit them
>> through http://www.company.com, the Object Identifier in the catalog is
>> listed as /data/objectid1. If I submit through
>> http://zopeinstance:8080/Client/company the Object Identifier in the
>> catalog is listed as /Client/company/data/objectid2.
>> 
>> A query on the catalog will return both records, however when I call
>> getObject() on the records returned, the record identified by the
>> relative path, ( /data/objectid1 ) returns None, while the record with
>> the full path, ( /Client/company/data/objectid2 ) returns the object.
>> 
>> So how do I correct this problem?  How is the 'Object Identifier' used
>> in the catalog generated?  Can I force it to use the full path when
>> cataloging objects?  Why is getObject() in the first case returning None?
>> 
>> Thanks,
>> Mark
>> 
>> 
>> _______________________________________________
>> 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 )
>>