Introduce buildout:zcml-additional-fragments buildout variable#10
Introduce buildout:zcml-additional-fragments buildout variable#10
Conversation
|
PullRequest created for |
|
@lukasgraf I see your points. The most important thing for me is that I don't have to think / do things when I use it in a "default" setup, meaning when I don't override zcml-additional. Currently this is the only place in The |
|
@lukasgraf I've pushed my proposal to your branch, implementing the |
|
@jone excellent! Going to drop my commit, change the title of the PR to something more generic and merge it. |
The buildout:zcml-additional-fragments variable helps wrapping the instanceX:zcml-additional option with a root configuration node, which allows to append to the buildout:zcml-additional-fragments any ZCML which will then properly set up. For more information regarding the source of the problem take a look at: plone/plone.recipe.zope2instance#13
Introduce buildout:zcml-additional-fragments buildout variable
This PR introduces a
buildout:zcml-additional-fragmentsbuildout variable that can be used to effectively extend the resultingzcml-additionalwith+=assignments.This is motivated by ZCML needed for
ftw.tika:tika-server.cfgcurrently includes[instance0] zcml-additional += ${tika:zcml}While it's a nice idea that
tika-server.cfgis completely self-configuring, I don't think this can work reliably:instance0:zcml-additionaloften gets overridden in buildouts that extend from theftw-buildouts.zcml-additionalneeds to be wrapped in a single<configure />element, appending to it from multiple places using+=doesn't work.Therefore I suggest to remove that
zcml-additional += ${tika:zcml}and instead document inREADME.rsthow to add tika's ZCML toinstance0:zcml-additionalin the buildout that extends fromtika-server.cfg. That way its left to the developer to make sure the ZCML is included properly in whatever other additional ZCML he has in his buildout.This issue really should be fixed in
plone.recipe.zope2instanceI guess - always wrap the contents ofzcml-additionalin an outer<configure />element if it contains more than one element.As a work-around, we do this in some of our buildouts:
buildout:zcml-additional-fragmentsbuildout:zcml-additional-fragmentsfrom multiple places using+=<configure />node and setzcml-additionalto that:[instance0] zcml-additional = <configure xmlns="http://namespaces.zope.org/zope"> ${buildout:zcml-additional-fragments} </configure>Maybe this pattern could also be useful in
ftw-buildouts.@jone any thoughts on this?