Manage configuration of browser views
This add-on does not provide new feature to Plone. It is intended to plone add-ons developers.
If you need to create a browser view with configuration this add-on will make your life easier.
- Configuration providers
- Configuration structure defined with zope.interface & zope.schema
- Store configuration with plone.app.registry
- Auto form to manage the configuration of the current view
Why doing this in an add-on
Because most of the time developers faced to this issue store data in the content type, or with annotation on context without trying to optimize, or without form, …
How it works
This add-ons define two components:
- Registry (IConfigurationStorage)
The main idea, is you just have to create an zope.interface to define settings schema and set this schema in the ‘settings_schema’ attributes of the view.
class IMyViewSettings(interface.Interface): width = schema.ASCIILine(title=u"Width", default='620') height = schema.ASCIILine(title=u"Height", default='620') class MyView(ConfigurableBaseView): settings_schema = IMyViewSettings def width(self): return self.settings.width def height(self): return self.settings.height
This component is responsible to return settings. It has been implemented as an adapter from your configurable view.
This component is implemented as a browserview. You have to inherits from this one to create your own browser view.
You can set the variable name throw the jsvarname attribute of your browserview.
You will find examples in the following addons:
- JeanMichel FRANCOIS aka toutpt <email@example.com>
- Radim Novotny aka naro
- Use collective.registry instead of provider/mutator [toutpt]
- add new classifiers [toutpt]
- fix tests [toutpt]
- fix issue making edit configuration not working [naro]
- Optimization of storage: defaults are now based on all provider except zope.app.annotation [toutpt]
- fix case where site.plone.app.registry are not set (value was set to None) [toutpt]
- Fix config form (http://stackoverflow.com/q/6524304/622081)
- Initial release
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size collective.configviews-2.0.tar.gz (22.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for collective.configviews-2.0.tar.gz