Re[2]: [Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Adam Groszer
Hello Dominik, Great, it's working. Thanks. Friday, November 4, 2005, 4:28:13 PM, you wrote: DH> Hi Adam DH> First you have to assert that you object (obj) provides ISite. Then I DH> would use the following attachted helper function `addLocalUtility` to DH> add the your utiltiy. Least, you co

Re: [Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Dominik Huber
Hi Adam First you have to assert that you object (obj) provides ISite. Then I would use the following attachted helper function `addLocalUtility` to add the your utiltiy. Least, you could use multi-subscriber for events providing IObjectEvent, then you don't have to check for IApplication. P

Re[2]: [Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Adam Groszer
Hello Dominik, I tried it using a subscriber. def App_boot(event): # precondition obj = event.object if not IApplication.providedBy(obj): return ensureUtility(obj, IWorkflowProcessRepository, 'WorkflowProcessRep

Re[2]: [Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Adam Groszer
Hello Dominik, I think (that may be stupid, because I'm not an expert) that the method is not 100% consistent, once it is checking on the passed folder's SM and then trying to add the utility to a maybe completely different SM. By the way, is the (sub) site going to be deprecated? I see some BBB'

Re: [Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Dominik Huber
Hi Adam You need location information (-> __parent__) for this setup. Regularly the object knows that information not until its addition to a container. Subscribe to ObjectAdded event and do the same setup within the handler and it will work. Regards, Dominik Adam Groszer wrote: I'd like t

[Zope3-dev] How to provide some default utilities for sub-site

2005-11-04 Thread Adam Groszer
I'd like to provide some default utilities for my sub-site. As I checked there is the nice ensureUtility method but as it turns out it failes with ... Module szscreen.app, line 339, in __init__ 'WorkflowUtility', WorkflowUtility, 'wfu') Module zope.app.appsetup.bootstrap, line 66, in ensur