Re: [Zope3-Users] How to make catalog working?

2006-05-17 Thread Florian Lindner
Am Dienstag, 16. Mai 2006 21:51 schrieb Frank Burkhardt:
> Hi,
>
> On Tue, May 16, 2006 at 07:08:34PM +0200, Florian Lindner wrote:
> > Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt:
>
> [snip]
>
> > > The IntID utility has to be registered *before* all the objects you
> > > want to find. No object created before you had a registered IntID
> > > will ever be found.
> > >
> > > Have a look at
> > >
> > >  http://zope3.mpg.de/suchen ("Das Prinzip")
> >
> > I've done that and it does not help.
>
> Are you sure, your object implements the interface, you're indexing? Use
> the introspector to find out.

I got the problem now.

My object was not adaptable to IKeyReference. It's now by subclassing 
Persistent.

Regards,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Florian Lindner
Am Dienstag, 16. Mai 2006 21:51 schrieb Frank Burkhardt:
> Hi,
>
> On Tue, May 16, 2006 at 07:08:34PM +0200, Florian Lindner wrote:
> > Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt:
>
> [snip]
>
> > > The IntID utility has to be registered *before* all the objects you
> > > want to find. No object created before you had a registered IntID
> > > will ever be found.
> > >
> > > Have a look at
> > >
> > >  http://zope3.mpg.de/suchen ("Das Prinzip")
> >
> > I've done that and it does not help.
>
> Are you sure, your object implements the interface, you're indexing? Use
> the introspector to find out.

Direkt bereitgestellte Schnittstellen
Keine Schnittstelle direkt bereitgestellt

Bereitgestellte Schnittstellen
xgm.interfaces.IAbbreviation <---
zope.annotation.interfaces.IAttributeAnnotatable 
zope.app.container.interfaces.IContained

I've marked the interface that I've configured the indexes on.

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Florian Lindner
Am Dienstag, 16. Mai 2006 21:23 schrieb Jim Washington:
> > The problem is not that objects have been created before the IntIDs
> > utility.
> >
> > The IntID utility says that 3 objects are registered, but the catalog
> > indexes are still zero count.
>
> This is a bit baffling.  Did you name your IntIDs utility?  The IntIDs
> utility works best when unnamed, I think.

No, it is registered as an unnamed utility. The name of the object itself was 
up to the NameChooser of the site.

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Frank Burkhardt
Hi,

On Tue, May 16, 2006 at 07:08:34PM +0200, Florian Lindner wrote:
> Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt:

[snip]

> > The IntID utility has to be registered *before* all the objects you
> > want to find. No object created before you had a registered IntID
> > will ever be found.
> >
> > Have a look at
> >
> >  http://zope3.mpg.de/suchen ("Das Prinzip")
> 
> I've done that and it does not help.

Are you sure, your object implements the interface, you're indexing? Use the
introspector to find out.

Regards,

Frank
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Jim Washington

> The problem is not that objects have been created before the IntIDs utility.
>
> The IntID utility says that 3 objects are registered, but the catalog indexes 
> are still zero count.
>
>   
This is a bit baffling.  Did you name your IntIDs utility?  The IntIDs
utility works best when unnamed, I think.

-Jim Washington


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Florian Lindner
Am Dienstag, 16. Mai 2006 13:23 schrieb Jim Washington:
> Frank Burkhardt wrote:
> > Hi,
> >
> > On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote:
> >> Hello,
> >> I've added some content objects of interface IFoo to my site.
> >> Then I added a catalog to my site (and also a IntID utility). I
> >> registered both. To the catalog I've added a FieldIndex and a TextIndex,
> >> set the interface to IFoo and the fieldname to a field that IFoo has. I
> >> registered both indexes.
> >
> > The IntID utility has to be registered *before* all the objects you
> > want to find. No object created before you had a registered IntID
> > will ever be found.
> >
> > Have a look at
> >
> >  http://zope3.mpg.de/suchen ("Das Prinzip")
>
> You can get the IntIDs utility to register objects after they are created.
>
> Something like the below will register and catalog a bunch of items:
>
> def catalog_items(self):
> intids = zapi.getUtility(IIntIds,[name])
> catalog = zapi.getUtility(ICatalog,[name])
> for item in some_function_that_returns_the_items():
> catalog.index_doc(intids.register(item), item)
>
> The most important part is the intids.register(item) statement.

The problem is not that objects have been created before the IntIDs utility.

The IntID utility says that 3 objects are registered, but the catalog indexes 
are still zero count.

Thanks,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Florian Lindner
Am Dienstag, 16. Mai 2006 12:02 schrieb Frank Burkhardt:
> Hi,
>
> On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote:
> > Hello,
> > I've added some content objects of interface IFoo to my site.
> > Then I added a catalog to my site (and also a IntID utility). I
> > registered both. To the catalog I've added a FieldIndex and a TextIndex,
> > set the interface to IFoo and the fieldname to a field that IFoo has. I
> > registered both indexes.
>
> The IntID utility has to be registered *before* all the objects you
> want to find. No object created before you had a registered IntID
> will ever be found.
>
> Have a look at
>
>  http://zope3.mpg.de/suchen ("Das Prinzip")

I've done that and it does not help.

The IntID utility says that 3 objects are registered, but the catalog indexes 
are still zero count.

Thanks.

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Jim Washington
Frank Burkhardt wrote:
> Hi,
>
> On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote:
>   
>> Hello,
>> I've added some content objects of interface IFoo to my site.
>> Then I added a catalog to my site (and also a IntID utility). I registered 
>> both. To the catalog I've added a FieldIndex and a TextIndex, set the 
>> interface to IFoo and the fieldname to a field that IFoo has. I registered 
>> both indexes.
>> 
>
> The IntID utility has to be registered *before* all the objects you
> want to find. No object created before you had a registered IntID
> will ever be found.
>
> Have a look at
>
>  http://zope3.mpg.de/suchen ("Das Prinzip")
>
>   
You can get the IntIDs utility to register objects after they are created.

Something like the below will register and catalog a bunch of items:

def catalog_items(self):
intids = zapi.getUtility(IIntIds,[name])
catalog = zapi.getUtility(ICatalog,[name])
for item in some_function_that_returns_the_items():
catalog.index_doc(intids.register(item), item)

The most important part is the intids.register(item) statement.

-Jim Washington

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to make catalog working?

2006-05-16 Thread Frank Burkhardt
Hi,

On Mon, May 15, 2006 at 11:16:09PM +0200, Florian Lindner wrote:
> Hello,
> I've added some content objects of interface IFoo to my site.
> Then I added a catalog to my site (and also a IntID utility). I registered 
> both. To the catalog I've added a FieldIndex and a TextIndex, set the 
> interface to IFoo and the fieldname to a field that IFoo has. I registered 
> both indexes.

The IntID utility has to be registered *before* all the objects you
want to find. No object created before you had a registered IntID
will ever be found.

Have a look at

 http://zope3.mpg.de/suchen ("Das Prinzip")

Regards,

Frank
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] How to make catalog working?

2006-05-15 Thread Florian Lindner
Hello,
I've added some content objects of interface IFoo to my site.
Then I added a catalog to my site (and also a IntID utility). I registered 
both. To the catalog I've added a FieldIndex and a TextIndex, set the 
interface to IFoo and the fieldname to a field that IFoo has. I registered 
both indexes.

But when I hit reindex nothing happends, and all counts show 0.

Why it does not find my content objects?

Thanks,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users