Using zcml.condition requires z3c.form to provide the appropriate features. The following patch does this:
--- configure.zcml.orig 2010-10-21 15:24:05.000000000 +0200 +++ configure.zcml 2010-10-21 15:40:58.000000000 +0200 @@ -1,6 +1,7 @@ <configure xmlns="http://namespaces.zope.org/zope" xmlns:i18n="http://namespaces.zope.org/i18n" + xmlns:meta="http://namespaces.zope.org/meta" i18n_domain="z3c.form">
<!-- default z3c.form layer --> @@ -9,6 +10,8 @@ type="zope.publisher.interfaces.browser.IBrowserSkinType" />
+ <meta:provides feature="z3c.form.checkbox-widget" /> + <meta:provides feature="z3c.form.radio-widget" />
<!-- Validators --> <adapter
After that, one can ask for these features in the configure.zcml of collective.singing. Because I'm lazy, I only checked for one feature, and put both widgets into one zcml file:
$ cat oldz3cform.zcml <z3c:widgetTemplate mode="hidden" widget="z3c.form.interfaces.ICheckBoxWidget" layer="z3c.form.interfaces.IFormLayer" template="checkbox_hidden.pt" />
<z3c:widgetTemplate mode="hidden" widget="z3c.form.interfaces.IRadioWidget" layer="z3c.form.interfaces.IFormLayer" template="checkbox_hidden.pt" />
$ diff -uw configure.zcml.orig configure.zcml --- configure.zcml.orig 2010-10-21 15:35:14.000000000 +0200 +++ configure.zcml 2010-10-21 15:34:16.000000000 +0200 @@ -1,24 +1,14 @@ <zope:configure xmlns:zope="http://namespaces.zope.org/zope" xmlns:z3c="http://namespaces.zope.org/z3c" + xmlns:zcml="http://namespaces.zope.org/zcml" xmlns="http://namespaces.zope.org/browser">
-</zope:configure> - <z3c:widgetTemplate - mode="hidden" - widget="z3c.form.interfaces.ICheckBoxWidget" - layer="z3c.form.interfaces.IFormLayer" - template="checkbox_hidden.pt" - /> - - <z3c:widgetTemplate - mode="hidden" - widget="z3c.form.interfaces.IRadioWidget" - layer="z3c.form.interfaces.IFormLayer" - template="checkbox_hidden.pt" - /> + <include file="oldz3cform.zcml" + zcml:condition="not-have z3c.form.checkbox-widget" />
<zope:adapter factory=".converters.DynamicVocabularyCollSeqConverter" />
+</zope:configure>
$
With these changes, I can now fire up a Plone 4 server with collective.dancing 0.9 installed. I've not checked with older versions, though.
Using zcml.condition requires z3c.form to provide the appropriate features. The following patch does this:
--- configure.zcml.orig 2010-10-21 15:24:05.000000000 +0200 namespaces. zope.org/ zope" namespaces. zope.org/ i18n" namespaces. zope.org/ meta" domain= "z3c.form" >
+++ configure.zcml 2010-10-21 15:40:58.000000000 +0200
@@ -1,6 +1,7 @@
<configure
xmlns="http://
xmlns:i18n="http://
+ xmlns:meta="http://
i18n_
<!-- default z3c.form layer -->
type="zope. publisher. interfaces. browser. IBrowserSkinTyp e"
@@ -9,6 +10,8 @@
/>
+ <meta:provides feature= "z3c.form. checkbox- widget" /> "z3c.form. radio-widget" />
+ <meta:provides feature=
<!-- Validators -->
<adapter
After that, one can ask for these features in the configure.zcml of collective.singing. Because I'm lazy, I only checked for one feature, and put both widgets into one zcml file:
$ cat oldz3cform.zcml widgetTemplate "z3c.form. interfaces. ICheckBoxWidget " "z3c.form. interfaces. IFormLayer" "checkbox_ hidden. pt"
<z3c:
mode="hidden"
widget=
layer=
template=
/>
<z3c: widgetTemplate "z3c.form. interfaces. IRadioWidget" "z3c.form. interfaces. IFormLayer" "checkbox_ hidden. pt"
mode="hidden"
widget=
layer=
template=
/>
$ diff -uw configure.zcml.orig configure.zcml namespaces. zope.org/ zope" namespaces. zope.org/ z3c" namespaces. zope.org/ zcml" namespaces. zope.org/ browser">
--- configure.zcml.orig 2010-10-21 15:35:14.000000000 +0200
+++ configure.zcml 2010-10-21 15:34:16.000000000 +0200
@@ -1,24 +1,14 @@
<zope:configure
xmlns:zope="http://
xmlns:z3c="http://
+ xmlns:zcml="http://
xmlns="http://
-</zope:configure> "z3c.form. interfaces. ICheckBoxWidget " z3c.form. interfaces. IFormLayer" "checkbox_ hidden. pt" "z3c.form. interfaces. IRadioWidget" z3c.form. interfaces. IFormLayer" "checkbox_ hidden. pt" m.zcml" "not-have z3c.form. checkbox- widget" />
- <z3c:widgetTemplate
- mode="hidden"
- widget=
- layer="
- template=
- />
-
- <z3c:widgetTemplate
- mode="hidden"
- widget=
- layer="
- template=
- />
+ <include file="oldz3cfor
+ zcml:condition=
<zope:adapter ".converters. DynamicVocabula ryCollSeqConver ter"
factory=
/>
+</zope:configure>
$
With these changes, I can now fire up a Plone 4 server with collective.dancing 0.9 installed. I've not checked with older versions, though.