TTW Dexterity Vocabularies

First report from the Tahoe Sprint working on user-enterable vocabularies in the schema editory.

So I’m here at the Tahoe Sprint thanks in part to a generous sponsorship by WebCollective. Thanks WebCollective!

This is the first year of what I hope will be many Tahoe Sprints and was focused on Dexterity. I decided to start by trying to implement TTW field vocabularies for the plone.schemaeditor TTW Zope 3 schema editor. The plone.schemaeditor is a generalized approach to TTW schema editing and does not depend on Dexterity but is at the heart of Dexterity’s TTW content type support. It had basic support for defining a few simple fields and adding support for user-selectable or user-entered vocabularies or sources seemed like the next step.

For those not familiar with Zope 3 schemata, fields that support choosing from a set of values can use either vocabularies or sources. Vocabularies are the older approach and are, roughly speaking, more suitable to simple sets or sequences of selectable values. Sources are a newer approach and are, roughly speaking, more suitable to complex choice behaviors such as searching for items to select, or choosing from very large sets of values where more conventional listing would not scale.

We discussed the various things one might want to do with specifying vocabularies or sources for fields. The simplest, and probably most common case, is where the user simply wants to enter the list of allowed values and have a simple selection widget presented when the field widget is rendered. For more complex sources, each source will have it’s own implementation specific set of options for the user to configure when creating the fields and as such each source will need it’s own add/edit form in the schema editor. We also discussed the possibility that users creating/editing schemata may want to re-use the same vocabulary or source across multiple fields, where those fields may themselves be in different schemata. Given all that we decided it was best to implement only simple vocabularies with a list of user-entered values on the field edit form and tackle the shared vocabulary and source support as a registry of vocabularies and sources that could be assigned to choice fields.

On the first day (well the first day not spent driving and socializing), I was able to get user-entered vocabularies working for single selection fields, labeled “Choice” for now in the schema editor. Early on the second day I finished user-entered vocabulary support for multiple-selection fields. If you’d like to take a look at it, fire up the dexterity development buildout and try it out.

Updated on 19 March 2010

Imported from Plone on Mar 15, 2021. The date for this update is the last modified date in Plone.

Comments

comments powered by Disqus