[Zope3-dev] RFC: zcml:condition
Roger Ineichen
dev at projekt01.ch
Thu Feb 17 17:20:49 EST 2005
Hi Jim
> -----Original Message-----
> From: zope3-dev-bounces+dev=projekt01.ch at zope.org
> [mailto:zope3-dev-bounces+dev=projekt01.ch at zope.org] On
> Behalf Of Jim Fulton
> Sent: Thursday, February 17, 2005 10:42 PM
> To: zope3-dev at zope.org
> Subject: [Zope3-dev] RFC: zcml:condition
>
>
> We've identified a real need for conditional ZCML
> processing.
>
> Consider an optional feature, like onlinehelp or zsync.
> These system define directives or components that individual
> packages will want to provide if these systems are available.
>
> For example, a package might want to register on-line-help
> documents if the on-line help system is available:
>
> <configure
> xmlns="http://namespaces.zope.org/zope"
> xmlns:help="http://namespaces.zope.org/help"
> zcml:condition="have onlinehelp"
> >
>
> <help:register
> id="zope.app.authentication"
> parent="dev"
> title="Authentication"
> doc_path="README.txt"
> class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
> />
>
> <help:register
> id="principalfolder"
> parent="dev/zope.app.authentication"
> title="Principal Folder"
> doc_path="principalfolder.txt"
> class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
> />
>
> <help:register
> id="groupfolder"
> parent="dev/zope.app.authentication"
> title="Group Folder"
> doc_path="groupfolder.txt"
> class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
> />
>
> </configure>
Can we use this condition like a sub configure directive:
<configure
xmlns="http://namespaces.zope.org/zope">
<browser:page
name="foo"
template="foo.pt"
...
/>
<configure
xmlns:help="http://namespaces.zope.org/help"
zcml:condition="have onlinehelp"
>
<help:register
id="zope.app.authentication"
parent="dev"
title="Authentication"
doc_path="README.txt"
class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
/>
<help:register
id="principalfolder"
parent="dev/zope.app.authentication"
title="Principal Folder"
doc_path="principalfolder.txt"
class="zope.app.onlinehelp.onlinehelptopic.RESTOnlineHelpTopic"
/>
</configure>
</configure>
Or what's the scope of the zcml:condition.
[...]
Regards
Roger Ineichen
Projekt01 GmbH
www.projekt01.ch
_____________________________
END OF MESSAGE
> Jim
>
> --
> Jim Fulton mailto:jim at zope.com Python Powered!
> CTO (540) 361-1714 http://www.python.org
> Zope Corporation http://www.zope.com http://www.zope.org
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub:
> http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch
>
>
More information about the Zope3-dev
mailing list