I want the ability to create vocabularies TTW

@rileydog you could fund the development work @jensens describes... that would be an awesome contribution to Plone!

@rileydog I'd like to start over with a very simple approach given the following base scenario:

I want/ my customers needs:

  1. a standardized format, to be exported and imported if needed
  2. multilingual vocabularies
  3. TTW editing of simple and tree vocabularies in Plone.

So let sketch me the base idea. But some code history first:
ATVM was written for Plone 2.1 and got extended with the help of lots of people. Today I'd no longer use content types to build up a list or tree to describe vocabularies. I also would not use the content translations to build up multilingual vocabularies.

How to implement it:

First we cover (1) and (2) above already with collective.vdexvocabulary. VDEX is in fact a very simple well defined XML format - simple if we skip the feature of references. Latter is rarely used and may be implemented later.

But c.vdexvocabulary does solve it on zcml level not on content level. Neither has it an editor. In c.vdexvocabulary vocabularies are registered with zcml. If we turn them into plone.resource based resources they can exist in FS and in ZODB. We change the registration part from zcml to registry.xml. Currently the ZCML directive registers a zope.schema.interfaces.IVocabularyFactory utility. We may turn this in a local component (which I personally dont like much, I'd investigatre here to find a better solution). We reuse the VdexTranslationDomain to handle translations.

Since then its easy to edit the xml ttw. With a control panel -also to create new vocabularies and a text field - maybe using ACE editor - its still editing XML and thats not that comfortable, but would work at first.

In a second step I'd write a JS editor for VDEX. This can be a simple one showing a tree at the left and a form for the entry at the right or something more complex, but since vdex is a tree of simple nodes key ->en: value, de:value, ... this is not that difficult, but needs some UI planning.

I'd not continue on c.vdexvocabulary but create a new package. c.vdexvocabulary is used in the wild and the code in it is not very consistent. Given one want to migrate from c.vdexvocabulary to the new package its easy because its just a vdex file to move around and some zcml to registry changes.

Reusing the treevocabulary code together with it's translation mechanism saves time and testing. It uses the imsvdex python package which is a bit aged but just works, at first I'd keep it as is.

Then we need the new registration and control panel.

Upon here we have a fully working addon. I'd say until I'd estimate roughly at 4-5 days plus 1 day fixing Plone bugs to be found while working on it.

The JS Editor for VDEX is now the next thing. This is difficult to estimate without a better concept. Very very roughly I estimate 1-2 days for UI/UX planning and 3-4 days for implementation.

Migration from ATVM:
Given one has important vocabularies in ATVM, even multilingual, the writing an exported to vdex is not complex. Given writing an exporter to CSV is even easier, vdexcsv may be used to convert.

Please, consider to use also SKOS because it is the new vocabulary/classifications standard and it is used a lot in various project. Most important international classifications are provided already in SKOS format.

@jensens you should really look at collective.taxonomy.

Testing it now for a multilinguall site and first impressions is that it t works. I can import a vdex with multiple languages, and they seem to follow the translations of the rest of the site.

I really like the automatic generated named vocabularies and behaviours, so it makes it very easy to use on dexterity content types and makes it easy to use for non developers.

Did you look at it?

@martior I had tried that, got lots of errors and site wouldn't start. I am running plone 5, not sure if I made that clear.

looking at https://pypi.python.org/pypi/collective.taxonomy/1.2.3 it is compatible with P4. Is there a P5 version anywhere?

Also, one thing I don't like is there is about a dozen of dependencies. Too many things to break. ATVocab doesn't have that. Just my preference to keep things as simple as possible. :slight_smile:

Like Cédric said in another thread, please take a look at what we did in our fork https://github.com/cedricmessiant/collective.taxonomy
We did a react based TTW tree editor and overlay to edit translations (to replace the poor jstree implementation). You can import/export a vdex file.
The app still need to be internationalized. We didn't have time to do that, so there is still no PR to the original repo.

3 Likes

thanks folks, I'll take a look at this in a few days.

Right, this site is still on plone4 with linguaplone but for this content type we use dexterity. @vincentfretin thanks for the tip, this site is hopefully getting plone 5 this year so that is very useful.

Slightly off topic: If you just need a few, one option could be to do it in the registry (lines or tuple) or in a control panel, and then just create it form there: https://github.com/collective/collective.lazysizes/blob/master/src/collective/lazysizes/vocabularies.py#L6 (change line 13 to whatever your registry entry is api.portal.get_registry_record('my.product.interfaces.IMySettings.myvocabulary')

It'd be nice to release it since the GitHub repo shows it's now Plone 5.0 and 5.1 compatible :slight_smile:

Looks like the release 1.4.4 already is Plone 5.x compatible!