How to create a new TermVocabulary

  1. Create a CSV file with at least the line for the vocabulary and store it along with the other terms (source:trunk/cdmlib/cdmlib-model/src/main/resources/terms)

  2. Create a class for the vocabulary (Example: source:trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/

  3. Add it to hibernate configuration source:trunk/cdmlib/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml

  4. Add it to source:trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/

But! For the testsuite to work, the test data has to be updated as well. Open source:trunk/cdmlib/cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml. Searching for the string "TERMVOCABULARY" will get you to the right location in the file. Add a new line for your vocabulary. E.g.:

<TERMVOCABULARY DTYPE="$$[Ordered]TermVocabulary$$" ID="$$increment the highest TermVocabulary id$$" CREATED="$$date of creation$$" UUID="$$unique UUID of your term vocabulary$$" URI="" TERMSOURCEURI="$$URI of your class. E.g. eu.etaxonomy.cdm.model.common.Language$$"/>

Repeat for "TERMVOCABULARY_AUD" accordingly.

Updated by Katja Luther over 1 year ago · 4 revisions