ref #6794 remove OrderedTermBase in app-import
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / io / redlist / bfnXml / in / BfnXmlImportAddtionalTerms.java
index 804f98ba67f2f652829fa4e26d9fe539ac8912a9..fe769eefad1141e1ad79eeb6cad9103b75df8a38 100644 (file)
@@ -6,7 +6,6 @@
 * 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;
@@ -14,37 +13,34 @@ import java.util.List;
 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"),
@@ -148,7 +144,7 @@ public class BfnXmlImportAddtionalTerms extends BfnXmlImportBase {
             "taxonNodes.taxon",
             "synonyms",
             "taxon.*",
-            "taxon.sec",
+            "taxon.secSource.citation",
             "taxon.name.*",
             "taxon.synonyms",
             "termVocabulary.*",
@@ -252,12 +248,6 @@ public class BfnXmlImportAddtionalTerms extends BfnXmlImportBase {
        }
        }
 
-
-       /**
-        * @param vocabularyService
-        * @param term
-        * @param vocUUID
-        */
        @SuppressWarnings({ "unchecked", "rawtypes" })
        private OrderedTermVocabulary createOrUpdateTermVocabulary(TermType termType, IVocabularyService vocabularyService, DefinedTermBase term, String strTermVocabulary) {
                OrderedTermVocabulary termVocabulary = null;
@@ -282,12 +272,12 @@ public class BfnXmlImportAddtionalTerms extends BfnXmlImportBase {
                }
                //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;