Wednesday, September 27, 2006
zcml:condition
Zope3demos was seemingly at a crossroads. On one hand I want to contribute working demos to the community, on the other hand I simply can't put any additional work into it other than what it takes for me to understand it.
I wanted to try Tres Seavers Pushpage app, but creating multiple branches of this project was creating a maintenance nightmare.
Zcml:condition to the rescue.
It doesn't seem to be covered in apidoc. Phillip says it will be covered in the next release of his book. I found this in a release announcement..
And this in Baiju's community documentation wiki http://kpug.zwiki.org/WhatIsNewInZope33
Note the additional namespace in configure. The verb "installed" is used, the package I'm checking for is the z3c.viewtemplate package.
Now only one branch is needed.
Kevin Smith
I wanted to try Tres Seavers Pushpage app, but creating multiple branches of this project was creating a maintenance nightmare.
Zcml:condition to the rescue.
It doesn't seem to be covered in apidoc. Phillip says it will be covered in the next release of his book. I found this in a release announcement..
ZCML now supports conditional directives using the 'zcml:condition'
attribute. The condition is of the form "verb argument". Two verbs, 'have
feature' and 'installed module' are currently implemented. Features can be
declared via the 'meta:provides' directive.
And this in Baiju's community documentation wiki http://kpug.zwiki.org/WhatIsNewInZope33
Added two new verbs for zcml:condition, 'not-have' andThe way I have used it
'not-installed', which are the negated counterparts to 'have'
and 'installed'.
< configure
xmlns="http://namespaces.zope.org/zope"
zcml="http://namespaces.zope.org/zcml"
i18n_domain="zope">
< include package=".demo1">
< include condition="installed z3c.viewtemplate" package=".viewtemplate1">
< /configure>
Note the additional namespace in configure. The verb "installed" is used, the package I'm checking for is the z3c.viewtemplate package.
Now only one branch is needed.
Kevin Smith
Wednesday, September 13, 2006
Zope3 Demos
There's alot of great code out there, but not a whole lot of examples on how to use that great code. I'm posting my experiments with the Zope3 component architecture in hopes that others will find it useful.
The examples are downloadable code, I've tried to make them as self-documenting as possible. The idea is that after you've downloaded the code, you can start toying with it to see how things fit together.
Project page: http://code.google.com/p/zope3demos/
svn checkout:
I hope you find it useful, all contributions and suggestions welcome.
Kevin Smith
Monterey County Weekly
Director of New Media and Internet Sales Manager
Monterey, CA
http://www.montereycountyweekly.com
The examples are downloadable code, I've tried to make them as self-documenting as possible. The idea is that after you've downloaded the code, you can start toying with it to see how things fit together.
Project page: http://code.google.com/p/zope3demos/
svn checkout:
svn checkout http://zope3demos.googlecode.com/svn/trunk/ zope3demos
I hope you find it useful, all contributions and suggestions welcome.
Kevin Smith
Monterey County Weekly
Director of New Media and Internet Sales Manager
Monterey, CA
http://www.montereycountyweekly.com