[Grok-dev] How do I override a GlobalUtility?

Sebastian Ware sebastian at urbantalk.se
Thu Jan 5 11:25:17 UTC 2012


Is it enough for me to register my own GlobalUtility with exactly the same configuration but in a file called "overrides.zcml"?

Mvh Sebastian

5 jan 2012 kl. 11.59 skrev Martin Aspeli:

> On 5 January 2012 10:45, Sebastian Ware <sebastian at urbantalk.se> wrote:
>> ZTK registers a GlobalUtility used for translation services with the interface "INegotiator", how do I override it with my own implementation in Grok?
> 
> The usual approach is via an overrides.zcml or in a local component
> site manager that's set in preference to the global one during the
> request.
> 
> Martin
> 
>> It is configured like this:
>> 
>> <configure xmlns="http://namespaces.zope.org/zope">
>> 
>>  <utility
>>      provides="zope.i18n.interfaces.INegotiator"
>>      component="zope.i18n.negotiator.negotiator"
>>      />
>> 
>> </configure>
>> 
>> Mvh Sebastian
>> 
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> https://mail.zope.org/mailman/listinfo/grok-dev




More information about the Grok-dev mailing list