System based on annotation to make a configurable browser view by Makina Corpus.
Project description
Introduction
Harlequin provide infrastructure to make configurable browser view without to have to deals with how the configuration data are stored. Most of the time developers faced to this issue store data in the model. This is bad because all instances have those data and do not necessary need it.
Your configuration view data are stored and your view can access to this configuration easily.
This module doesn’t provide any ‘user’ feature to Plone.
How to use it
You want to develop a browser view that need configuration ? Make your browser view inherits from collective.harlequin.browser.Harlequin (or implements IHarlequinView)
Next you can define your configuration with a zope.schema interface which inherits from collective.harlequin.forms.Schema
Next you have to make your z3cform with the configuration schema and inherits from collective.harlequin.forms.Form.
You have to attach the form to your browser view by override the method ‘harlequin_form’. Make it return the Page form wrapper class.
Next make your view available in the display drop down menu, and try by selecting it ! You get The form displayed, fill it and validate it, the job is made for you.
How it works
It override the setViewTemplate script, verify if the asked view is harlequin one. If it is the case it mark the view to display the configuration form.
z3cform is used to display the configuration form.
Configuration are stored with an adapter over the context. Two adapters are available:
use property manager.
use annotation.
For ATContTypes annotation will be used.
WARNING: the property manager is not working that much and is never used on a default Plone.
Credits
Authors
JeanMichel FRANCOIS aka toutpt <toutpt@gmail.com>
Contributors
Changelog
1.0b2 (2010-05-28)
Nothing changed yet.
1.0b1 (2010-05-27)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.