Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Dominik Huber wrote: handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) Regards, Dominik From the apidoc for IWriteContainer.__setitem__(name, object) it states.. ''If an add event is generated and the object can be adapted to IObjectAddedEvent, then the adapter's addNotify method is called with the event.'' This could be alternative way to implement the the subscriber solution above. However, from looking at the code (Zope3.1) it doesn't seem to to what the apidoc claims. Does anybody know if this is still intended? -Tom ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Dominik Huber wrote: Johan Carlsson wrote: I've tried this, it doesn't remove the NotYet problem though!?? Our framework relies on that concept and it is still working ;) Did you assert to add the catalog to the sitemanagement folder before adding its indexes? I found the error, in the AddView I had to remove the security context to be able to setup things, I don't need that in the event handler. The removed security context appears to have been the reason for the NotYet problems. Thanks for kicking me in the right direction :-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson wrote: Dominik Huber wrote: Hi Johan Your problem is that the catalog is not locatable itself during the addition of its indexes (-> state within the create and add method), therefore the location of the indexes cannot be located and the NotYetError is raised. You can move your code to an ObjectAddedEvent-subscriber for your object. handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) I've tried this, it doesn't remove the NotYet problem though!?? Our framework relies on that concept and it is still working ;) Did you assert to add the catalog to the sitemanagement folder before adding its indexes? Dominik begin:vcard fn:Dominik Huber n:Huber;Dominik email;internet:[EMAIL PROTECTED] tel;work:++41 56 534 77 30 x-mozilla-html:FALSE version:2.1 end:vcard ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Dominik Huber wrote: Hi Johan Your problem is that the catalog is not locatable itself during the addition of its indexes (-> state within the create and add method), therefore the location of the indexes cannot be located and the NotYetError is raised. You can move your code to an ObjectAddedEvent-subscriber for your object. handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) I've tried this, it doesn't remove the NotYet problem though!?? Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Dominik Huber wrote: Hi Johan Your problem is that the catalog is not locatable itself during the addition of its indexes (-> state within the create and add method), therefore the location of the indexes cannot be located and the NotYetError is raised. You can move your code to an ObjectAddedEvent-subscriber for your object. handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) Ok, that's by the way how Ivo does it (I've just read). Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Hi Johan Your problem is that the catalog is not locatable itself during the addition of its indexes (-> state within the create and add method), therefore the location of the indexes cannot be located and the NotYetError is raised. You can move your code to an ObjectAddedEvent-subscriber for your object. handler pseudo code: def addCatalogAndIndex(obj, event): sm = zapi.getNextSiteManager(obj) catalog = Catalog() addLocalUtility(sm, 'XY', ICatalog, catalog) catalog[name] = Index(name, IAnyInterface) Regards, Dominik Johan Carlsson wrote: Gary Poster wrote: Hm. A very quick look at the patch concerns me a bit. Am I right that, if you apply the patch, then requests that are currently raising a NotYet for you will instead silently fail, not cataloging what you requested? That seems undesirable to me. I'd prefer the exception. If I'm on the right track here, then the extentcatalog in the zc.catalog package in the sandbox probably is one of possibly many other better solutions than the patch. It postpones cataloging to the end of the transaction, which I believe will remove the NotYet exceptions *and* successfully catalog your data. In my case I'm not interested in cataloging anything, there reason is I'm just adding new fields to a newly created catalog and there aren't any object to catalog just yet. I'm guessing Ivo has similare problems because he also are creating the catalog programmetically. I'm doing this as a part of a custom add view that defines a overrided createAndAdd(self, data), I think Ivo does it in a more CMF like fashion (just after quick glans on his code). I don't have the faintest idea what NotYet is supposted to be raise for? Accutally I'm haveing problems finding the code that does this because the traceback is Zope 3 cryptic and I don't have a debugger setup either. (I was hoping not having to care about the innerworks of the catalog, but that maybe is too much too hope for ;-) Johan -- Dominik Huber Perse Engineering GmbH Jurastrasse 9a CH-5406 Baden E-Mail: [EMAIL PROTECTED] Telefon: ++41 56 534 7730 begin:vcard fn:Dominik Huber n:Huber;Dominik email;internet:[EMAIL PROTECTED] tel;work:++41 56 534 77 30 x-mozilla-html:FALSE version:2.1 end:vcard ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Gary Poster wrote: Hm. A very quick look at the patch concerns me a bit. Am I right that, if you apply the patch, then requests that are currently raising a NotYet for you will instead silently fail, not cataloging what you requested? That seems undesirable to me. I'd prefer the exception. If I'm on the right track here, then the extentcatalog in the zc.catalog package in the sandbox probably is one of possibly many other better solutions than the patch. It postpones cataloging to the end of the transaction, which I believe will remove the NotYet exceptions *and* successfully catalog your data. In my case I'm not interested in cataloging anything, there reason is I'm just adding new fields to a newly created catalog and there aren't any object to catalog just yet. I'm guessing Ivo has similare problems because he also are creating the catalog programmetically. I'm doing this as a part of a custom add view that defines a overrided createAndAdd(self, data), I think Ivo does it in a more CMF like fashion (just after quick glans on his code). I don't have the faintest idea what NotYet is supposted to be raise for? Accutally I'm haveing problems finding the code that does this because the traceback is Zope 3 cryptic and I don't have a debugger setup either. (I was hoping not having to care about the innerworks of the catalog, but that maybe is too much too hope for ;-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
On Nov 17, 2005, at 9:05 AM, Johan Carlsson wrote: Johan Carlsson wrote: Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: The code you gave me shows the same showed the same problem as Jürgen pointied out, the IntId needs to have '' as id. I remember having some real issues with IntId / Catalog, I doubt if they ever really got fixed. Check the patch in INSTALL.txt: https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/ INSTALL.txt It once used to work for me, at least :) Ah, thanks for the heads up. Now I see, that's exactly what been bitting my butt all along. The patch fixes the problem! Hm. A very quick look at the patch concerns me a bit. Am I right that, if you apply the patch, then requests that are currently raising a NotYet for you will instead silently fail, not cataloging what you requested? That seems undesirable to me. I'd prefer the exception. If I'm on the right track here, then the extentcatalog in the zc.catalog package in the sandbox probably is one of possibly many other better solutions than the patch. It postpones cataloging to the end of the transaction, which I believe will remove the NotYet exceptions *and* successfully catalog your data. Apologies if my quick patch read is off base. Gary___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson wrote: Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: The code you gave me shows the same showed the same problem as Jürgen pointied out, the IntId needs to have '' as id. I remember having some real issues with IntId / Catalog, I doubt if they ever really got fixed. Check the patch in INSTALL.txt: https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt It once used to work for me, at least :) Ah, thanks for the heads up. Now I see, that's exactly what been bitting my butt all along. The patch fixes the problem! Thanks again, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: The code you gave me shows the same showed the same problem as Jürgen pointied out, the IntId needs to have '' as id. I remember having some real issues with IntId / Catalog, I doubt if they ever really got fixed. Check the patch in INSTALL.txt: https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt It once used to work for me, at least :) Ah, thanks for the heads up. Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
j.kartnaller wrote: The name doesn't seem to have any importance (see my correction). Also (afaik) it's not possible to add a object with an empty name through the ZMI. This is a know issue which was solved in the trunk and will be in 3.2. Anyway you can rename after creating the utility. Yeah, I noticed that after my first responce. Thanks again, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson wrote: j.kartnaller wrote: Johan Carlsson wrote: Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') The IntId utility must not have an name as you see in the message. Just rename your IntId utility and your up and running. The name doesn't seem to have any importance (see my correction). Also (afaik) it's not possible to add a object with an empty name through the ZMI. This is a know issue which was solved in the trunk and will be in 3.2. Anyway you can rename after creating the utility. Jürgen ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: > > The code you gave me shows the same showed the same problem as Jürgen > pointied out, the IntId needs to have '' as id. I remember having some real issues with IntId / Catalog, I doubt if they ever really got fixed. Check the patch in INSTALL.txt: https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/doc/INSTALL.txt It once used to work for me, at least :) -- Drs. I.R. van der Wijk / m3r Consultancy B.V. Linux/Python/Zope/Plone and Open Source solutions PO-box 51091, 1007 EB Amsterdam, The Netherlands Email: ivo m3r.nl ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
And thanks both of you for really fast replies :-) Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. I managed to create a working Catalog/IntId setup in cubic, along with actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). I can't remember details right now (been to long), but you could take a peak at the code at https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ Specifically, https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py and https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py might give you some directions. The code you gave me shows the same showed the same problem as Jürgen pointied out, the IntId needs to have '' as id. Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
j.kartnaller wrote: Johan Carlsson wrote: Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') The IntId utility must not have an name as you see in the message. Just rename your IntId utility and your up and running. No I was infact quite worng, it is possible to change the ZMI, just that one has too do it though the Site Manager not the contents view. And it solves the problem too. Thanks a bunch! Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Ivo van der Wijk wrote: On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. I managed to create a working Catalog/IntId setup in cubic, along with actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). I can't remember details right now (been to long), but you could take a peak at the code at https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ Specifically, https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py and https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py might give you some directions. Excellent, Probably exactly what I need :-) I'll have a look. Thanks, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
j.kartnaller wrote: Johan Carlsson wrote: Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') The IntId utility must not have an name as you see in the message. Just rename your IntId utility and your up and running. The name doesn't seem to have any importance (see my correction). Also (afaik) it's not possible to add a object with an empty name through the ZMI. Thanks anyway, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson wrote: Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') The IntId utility must not have an name as you see in the message. Just rename your IntId utility and your up and running. I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. My bad, ComponentLookupError is what I get if I don't have setup an IntIds utility, if I have set one up (currently mine is named IntIds in the tools folder of the root site manager) I get: Error type: zope.app.keyreference.interfaces.NotYet Error object: Jürgen ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
On 11/17/05, Johan Carlsson <[EMAIL PROTECTED]> wrote: > > Anyone had any success with ZCatalog in Zope 3? > > I'm trying to add indexes to the catalog > but I get an ComponentLookupError: > > Error type: zope.component.interfaces.ComponentLookupError > Error object: (, '') > > I'm not sure how to setup the IntIds utility, what I've done so far > is just add one and give it an random name. > I managed to create a working Catalog/IntId setup in cubic, along with actual indexing/searching (and a quick'n'dirty port of TextIndexNG3). I can't remember details right now (been to long), but you could take a peak at the code at https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/ Specifically, https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/cubicportal.py and https://secure.m3r.nl/repos/opensource/zope3/cubic/trunk/cubic/core/catalog/catalog.py might give you some directions. Regards, Ivo -- Drs. I.R. van der Wijk / m3r Consultancy B.V. Linux/Python/Zope/Plone and Open Source solutions PO-box 51091, 1007 EB Amsterdam, The Netherlands Email: ivo m3r.nl ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Johan Carlsson wrote: Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. My bad, ComponentLookupError is what I get if I don't have setup an IntIds utility, if I have set one up (currently mine is named IntIds in the tools folder of the root site manager) I get: Error type: zope.app.keyreference.interfaces.NotYet Error object: -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Anyone had any success with ZCatalog in Zope 3? I'm trying to add indexes to the catalog but I get an ComponentLookupError: Error type: zope.component.interfaces.ComponentLookupError Error object: (, '') I'm not sure how to setup the IntIds utility, what I've done so far is just add one and give it an random name. Regards, Johan -- Johan Carlsson Tel: + 46 8 31 24 94 Colliberty Mob: + 46 70 558 25 24 Torsgatan 72Email: [EMAIL PROTECTED] SE-113 37 STOCKHOLM ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users