Re: [Zope] utilities @ the site level

2009-12-30 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Pharis wrote:
> So createObject does look in the context of the current site. My issue was
> somewhere else. I'm still interested to know if you can register utilities
> at the site level in ZCML though.

No:  ZCML is only used to populate the "global" component registry.
Local / persistent registries get populated either through some UI
interaction or via something like a GenericSetup import steup (there is
a corrsponding export step for saving the local utility / adapter
registrations as a text file).

It might be an interesting exercise to write a local-but-non-persistent
registry whose only persistent property was the filesystem path to a
ZCML file, which would be read and parsed when the first lookup
occurred:  AFAIK, no such animal exists today.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAks8EsMACgkQ+gerLs4ltQ5X5QCgqKdisC1W0DXjwhnlnJCJwUG4
YqMAnArOioan9PB8wcDipAQBW3e0uSZh
=Qaa0
-END PGP SIGNATURE-

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] utilities @ the site level

2009-12-30 Thread Jim Pharis
So createObject does look in the context of the current site. My issue was
somewhere else. I'm still interested to know if you can register utilities
at the site level in ZCML though.

On Wed, Dec 30, 2009 at 3:22 PM, Jim Pharis  wrote:

> I should clarify that createobject is failing with a ComponentLookupError.
>
>
> On Wed, Dec 30, 2009 at 2:45 PM, Jim Pharis  wrote:
>
>>
>> Can I register utilities at the site level in zcml? And once I have the
>> local utility registered, how do I pass that site manager context to my
>> browser/forms so I can do things like createObject. createObject seems to
>> fail because it can't find the utility, but I think that's because its not
>> looking for the utililty at the site level.
>>
>> I'm using Zope2.12 w/five.localsitemanager.
>>
>> Thanks,
>>
>> - Jim
>>
>>
>
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] utilities @ the site level

2009-12-30 Thread Jim Pharis
I should clarify that createobject is failing with a ComponentLookupError.

On Wed, Dec 30, 2009 at 2:45 PM, Jim Pharis  wrote:

>
> Can I register utilities at the site level in zcml? And once I have the
> local utility registered, how do I pass that site manager context to my
> browser/forms so I can do things like createObject. createObject seems to
> fail because it can't find the utility, but I think that's because its not
> looking for the utililty at the site level.
>
> I'm using Zope2.12 w/five.localsitemanager.
>
> Thanks,
>
> - Jim
>
>
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] utilities @ the site level

2009-12-30 Thread Jim Pharis
Can I register utilities at the site level in zcml? And once I have the
local utility registered, how do I pass that site manager context to my
browser/forms so I can do things like createObject. createObject seems to
fail because it can't find the utility, but I think that's because its not
looking for the utililty at the site level.

I'm using Zope2.12 w/five.localsitemanager.

Thanks,

- Jim
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )