TermVocabularyHowTo » History » Revision 1
Revision 1/4
| Next »
Niels Hoffmann, 11/15/2010 03:53 PM
How to create a new TermVocabulary¶
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)
Create a class for the vocabulary (Example: source:trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Language.java)
Add it to hibernate configuration source:trunk/cdmlib/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml
Add it to source:trunk/cdmlib/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java
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 Niels Hoffmann over 13 years ago · 1 revisions