* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.redlist.bfnXml.in;
import java.util.Arrays;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionStatus;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.OrderedTermBase;
-import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
-import eu.etaxonomy.cdm.model.common.TermType;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
import eu.etaxonomy.cdm.model.location.NamedAreaType;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
/**
- *
* This class creates all area vocabularies and all distribution status vocabularies
* for the German redlists.
*
* @author a.oppermann
* @author a.mueller
- * @date 04.07.2013
- *
+ * @since 04.07.2013
*/
@Component
public class BfnXmlImportAddtionalTerms extends BfnXmlImportBase {
private static final long serialVersionUID = 8997499338798245806L;
-
- private static final Logger logger = Logger.getLogger(BfnXmlImportAddtionalTerms.class);
+ private static final Logger logger = LogManager.getLogger();
public enum Vocabulary{
GERMAN_FEDERAL_STATES("Bundesländer"),
"taxonNodes.taxon",
"synonyms",
"taxon.*",
- "taxon.sec",
+ "taxon.secSource.citation",
"taxon.name.*",
"taxon.synonyms",
"termVocabulary.*",
}
}
-
- /**
- * @param vocabularyService
- * @param term
- * @param vocUUID
- */
@SuppressWarnings({ "unchecked", "rawtypes" })
private OrderedTermVocabulary createOrUpdateTermVocabulary(TermType termType, IVocabularyService vocabularyService, DefinedTermBase term, String strTermVocabulary) {
OrderedTermVocabulary termVocabulary = null;
}
//create termvocabulary
if(termVocabulary == null){
- termVocabulary = OrderedTermVocabulary.NewInstance(termType, strTermVocabulary, strTermVocabulary, strTermVocabulary, null);
+ termVocabulary = OrderedTermVocabulary.NewOrderedInstance(termType, null, strTermVocabulary, strTermVocabulary, strTermVocabulary, null);
if(vocUUID != null){
termVocabulary.setUuid(vocUUID);
}
}
- termVocabulary.addTerm((OrderedTermBase) term);
+ termVocabulary.addTerm(term);
vocabularyService.saveOrUpdate(termVocabulary);
return termVocabulary;