What this package do?
IMS VDEX is a standard for exchanging vocabularies. collective.vdexvocabulary create bridge
between vdex vocabularies and zope vocabularies, so you can easily use it in systems like
Plone / Zope.
Contents
What this package do?
Whats so special about it?
How do I use it?
Example VDEX file
How to access relations (from code)
Where can I complain / help / send rum?
Credit
TODO
History
0.1.2 (2014-01-07)
0.1.1 (2010-10-11)
0.1 (2010-06-23)
0.1a1 (2010-04-29)
Whats so special about it?
Imagine you have big vocabularies with a lot of relations. I'm talking +10.000 terms with +30.000
relations. So this would be perfect use case to use collective.vdexvocabulary. Also there are other
stuff which I didn't found in other vocabulary packages for Plone/Zope:
i18n support (as it is defined in IMS VDEX)
proper order also with unicode charecters (if zope.ucol is installed)
easy registration using zcml
relations as it specified in IMS VDEX standard
How do I use it?
In your configure.zcml add:
And to register a vdex vocabulary simply add line bellow pointing to file containing vdex
vocabulary:
To make registration of vocabularies even easier you can also register several vocabularies and
just point to directory:
vdex files in path-to/my-vdex-vocabularies directory should have ending .vdex to be recognized
by vdex:vocabulary ZCML directive.
Example VDEX file
Example of car manufacturers list (car_manufacturers.vdex).:
your.package.car_manufacturers
ford
Ford
Una miedra de coche
bmw
BMW
Be-eMe-uWe, mierda
bmw
very-special-bmw-model
NT
...
List of car models (car_models.vdex).:
your.package.car_models
very-special-bmw-model
Very special BMW model
Un modelo de Be-eMe-uWe
very-special-bmw-model
bmw
BT
...
How to access relations (from code)
Relations are defined by ISO2788.
To get listing of BMW car models from above VDEX example you have to:
from zope.schema.vocabulary import getVocabularyRegistry
vr = getVocabularyRegistry()
car_manufacturers = vr.get(self.context, your.package.car_manufacturers )
car_models = vr.get(self.context, your.package.car_models )
bmw = car_manufacturers.getTerm(bmw )
bmw_car_models = bmw.related.get(NT , [])
|