Hi Andreas

Behalf Of Andreas Jung
> Sent: Saturday, May 21, 2005 1:00 PM
> To: zope3-dev@zope.org
> Subject: [Zope3-dev] error checking in included ZCML files
> 
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Error checking in included zcml files
> Date-Sent: Samstag, 21. Mai 2005 13:03 Uhr
> 
> Hi,
> 
> I tried to refactor the configure.zcml of TextIndexNG3 into a 
> configuration 
> file
> which is related to the core engine and one file that contains Zope 2 
> specific
> directives (browser:view etc).
> 
> The main configure.zcml (to be used by Five) is in
> Products/TextIndexNG3/configure.zcml and contains a line
> 
> <include package="textindexng" file="configure.zcml" />
> 
> So far so good.....just for testing purposes I added the an <utility>
> directive multiple times (which identical attributes) in
> Products/TextIndexNG3/src/textindexng/configure.zcml
> .....I restarted Zope and expected that Zope would not start because
> of the identical directives...however it came up. Adding the same
> identical in Products/TextIndexNG3/configure.zcml caused an exception
> when Zope was starting. So why do we have different behaviour here?
> Bug or Feature?

The ZCML registration process remembers which configure.zcml 
was loaded, this means you can load a configure.zcml more then once.
It only get's loaded one time. (The first time)

If you duplicate a directive directly in a configure.zcml
then it ends in a duplication error. 

This is needed for some use case where you have to load 
a configuration befor they is loaded normaly. (If you add
own packages and have to use some configuration.) 
Because the packages are loaded in a alphabetic 
order. Menus are a good example for this.

btw, this is useful if we don't have different layers
e.g. application layer in 3rd party packages.

This is related to Zope3. I think this is similar to Five.

Regards
Roger Ineichen

> -aj
> 
>     
> --------------------------------------------------------------
> ---------
>    -   Andreas Jung            ZOPYX Software Development and 
> Consulting -
>   -   E-mail: [EMAIL PROTECTED]   Web: www.zopyx.com             
>           -
>    
> --------------------------------------------------------------
> ---------
> 

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to