Local Vocabulary

Revision: $Id$

Contents

1   Architecture

There are local vocabulary container and local vocabulary. By default container is created with id '.cps_vocabularies'

Local vocabulary has two string properties that control behaviour how values for given local vocabulary are computed, they are:

Combining values of above two properties we define the way how we are going get values for our local vocabulary.

1.1   Case 1

Local vocabulary with given id is present in local vocabulary container.

  1. inheritance_type = 'inherit' AND merge_behaviour = 'None'

    Only the content of this local vocabulary is used.

  2. inheritance_type = 'inherit' AND merge_behaviour = 'union'

    Union with the 'above' local vocabulary, which itself may be defined as it sees fit.

  3. inheritance_type = 'global' AND merge_behaviour = 'None'

    Local vocabulary is ignored and the global one is used.

  4. inheritance_type = 'global' AND merge_behaviour = 'union'

    Union with the global vocabulary

Local vocabulary container itself has the same two properties as local vocabulary, which are used to determine behaviour in case there is no local vocabulary with given id in container, so we have case 2.

1.2   Case 2

There is no local vocabulary with given id in container. Further behaviour is defined by properties of container. In this case only inheritance_type does matter.

  1. inheritance_type = 'inherit'

    Use 'above' local vocabulary, which itself may be defined as it sees fit.

  2. inheritance_type = 'global'

    Use global vocabulary.

N.B. The global vocabulary always will be the default when inheriting and nothing is found in the above containers.

2   ZMI

From the ZMI, you can add local vocabulary container, which will have a 'Global vocabularies' tab that lists all global vocabularies you can customize. After creation you can edit local vocabulary same as global one.

3   API

VocabulariesTool provides method getVocabularyFor(context. voc_id) that returns local vocabulary for passed context.