commit ac9742df59656534ab277f1a5586e648692fe21e
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Tue Mar 22 10:02:09 2016 +0100

    Import nomenclatural status

diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
index a1818e09..5468f6fe 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
@@ -29,6 +29,8 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.BotanicalName;
+import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
+import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
 import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
@@ -111,11 +113,12 @@ public class RedListGefaesspflanzenImportNames extends DbImportBase<RedListGefae
         String authorKombString = rs.getString(RedListUtil.AUTOR_KOMB);
         String authorBasiString = rs.getString(RedListUtil.AUTOR_BASI);
 
+        //---NAME---
         if(CdmUtils.isBlank(taxNameString) && CdmUtils.isBlank(ep1String)){
             RedListUtil.logMessage(id, "No name found!", logger);
         }
 
-        Rank rank = makeRank(state, rangString);
+        Rank rank = makeRank(id, state, rangString);
         if(rank==null){
             RedListUtil.logMessage(id, "Rank could not be resolved.", logger);
         }
@@ -135,6 +138,12 @@ public class RedListGefaesspflanzenImportNames extends DbImportBase<RedListGefae
                 name.setInfraSpecificEpithet(ep3String);
             }
         }
+        //nomenclatural status
+        NomenclaturalStatusType status = makeNomenclaturalStatus(id, state, nomZusatzString);
+        if(status!=null){
+            name.addStatus(NomenclaturalStatus.NewInstance(status));
+        }
+
 
         //--- AUTHORS ---
         //combination author
@@ -247,7 +256,7 @@ public class RedListGefaesspflanzenImportNames extends DbImportBase<RedListGefae
         state.getTaxonMap().put(id, taxonBase.getUuid());
     }
 
-    private Rank makeRank(RedListGefaesspflanzenImportState state, String rankStr) {
+    private Rank makeRank(long id, RedListGefaesspflanzenImportState state, String rankStr) {
         Rank rank = null;
         try {
             rank = state.getTransformer().getRankByKey(rankStr);
@@ -255,11 +264,24 @@ public class RedListGefaesspflanzenImportNames extends DbImportBase<RedListGefae
             e.printStackTrace();
         }
         if(rank==null){
-            logger.error(rankStr+" could not be associated to a known rank.");
+            RedListUtil.logMessage(id, rankStr+" could not be associated to a known rank.", logger);
         }
         return rank;
     }
 
+    private NomenclaturalStatusType makeNomenclaturalStatus(long id, RedListGefaesspflanzenImportState state, String nomZusatzString) {
+        NomenclaturalStatusType status = null;
+        try {
+            status = state.getTransformer().getNomenclaturalStatusByKey(nomZusatzString);
+        } catch (UndefinedTransformerMethodException e) {
+            e.printStackTrace();
+        }
+        if(status==null){
+            RedListUtil.logMessage(id, nomZusatzString+" could not be associated to a known nomenclatural status.", logger);
+        }
+        return status;
+    }
+
 
 
     @Override
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenTransformer.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenTransformer.java
index c1a71148..ec7e8676 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenTransformer.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenTransformer.java
@@ -14,6 +14,7 @@ import org.apache.log4j.Logger;
 
 import eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase;
 import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
+import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
 import eu.etaxonomy.cdm.model.name.Rank;
 
 /**
@@ -52,6 +53,19 @@ public final class RedListGefaesspflanzenTransformer extends InputTransformerBas
         return null;
     }
 
-
+    @Override
+    public NomenclaturalStatusType getNomenclaturalStatusByKey(String key) throws UndefinedTransformerMethodException {
+        if (key == null){return null;}
+        if (key.equals("nom. cons.")){return NomenclaturalStatusType.CONSERVED();}
+        else if (key.equals("nom. illeg.")){return NomenclaturalStatusType.ILLEGITIMATE();}
+        else if (key.equals("nom. inval.")){return NomenclaturalStatusType.INVALID();}
+        else if (key.equals("nom. ambig.")){return NomenclaturalStatusType.AMBIGUOUS();}
+        else if (key.equals("nom. nud.")){return NomenclaturalStatusType.NUDUM();}
+        else if (key.equals("nom. rejic.")){return NomenclaturalStatusType.REJECTED();}
+        else if (key.equals("nom. utique rejic.")){return NomenclaturalStatusType.UTIQUE_REJECTED();}
+        else if (key.equals("nom. utique rejic. pro.")){return NomenclaturalStatusType.UTIQUE_REJECTED_PROP();}
+        else if (key.equals("comb. nov.")){return NomenclaturalStatusType.COMB_NOV();}
+        return null;
+    }
 
 }
