commit 74d84f793d0eb257aea208c042965a735a5ad60d
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Tue Sep 13 00:07:51 2016 +0200

    ref #6026 using genera as higher taxon for species

diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java
index 2d8837e8..9cf1fd13 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java
@@ -35,14 +35,14 @@ import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 public class IAPTActivator {
     private static final Logger logger = Logger.getLogger(IAPTActivator.class);
 
-    public static final String DATA_FILE_0_100 = "iapt-100.xls";
     public static final String DATA_FILE_FULL = "Registration_DB_from_BGBM17.xls";
+    public static final String DATA_FILE_0_100 = "iapt-100.xls";
     public static final String DATA_ENCODING_PROBLEMS = "encoding-problems.xls";
     public static final String DATA_IAPT_TYPES_100 = "iapt-types-100.xls";
     public static final String DATA_TYPE_LEG_100 = "iapt-type-leg-100.xls";
     public static final String DATA_NAME_TYPES = "iapt-name-types.xls";
     public static final String DATA_SINGLE = "single.xls";
-    public static final String DATA_FILE = DATA_SINGLE;
+    public static final String DATA_FILE = DATA_FILE_FULL;
 
     //database validation status (create, update, validate ...)
     static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java
index df75de32..07359397 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java
@@ -10,6 +10,7 @@
 package eu.etaxonomy.cdm.io.iapt;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImport;
 import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
@@ -340,11 +341,26 @@ public class IAPTExcelImport<CONFIG extends IAPTImportConfigurator> extends Simp
         }
 
         getTaxonService().save(taxon);
+
+        if(taxonName.getRank().equals(Rank.SPECIES()) || taxonName.getRank().isLower(Rank.SPECIES())){
+            // try to find the genus, it should have been imported already, Genera are coming first in the import file
+            Taxon genus = ((IAPTImportState)state).getGenusTaxonMap().get(taxonName.getGenusOrUninomial());
+            if(genus != null){
+                higherTaxonNode = genus.getTaxonNodes().iterator().next();
+            } else {
+                logger.info(csvReportLine(regNumber, "Parent genus not found for", nameStr));
+            }
+        }
+
         if(higherTaxonNode != null){
             higherTaxonNode.addChildTaxon(taxon, null, null);
             getTaxonNodeService().save(higherTaxonNode);
         }
 
+        if(taxonName.getRank().isGenus()){
+            ((IAPTImportState)state).getGenusTaxonMap().put(taxonName.getGenusOrUninomial(), taxon);
+        }
+
         return taxon;
     }
 
@@ -1054,6 +1070,7 @@ public class IAPTExcelImport<CONFIG extends IAPTImportConfigurator> extends Simp
         ((IAPTImportState)state).setCurrentTaxon(taxon);
 
 
+        logger.info("#of imported Genera: " + ((IAPTImportState) state).getGenusTaxonMap().size());
 		return;
     }
 
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTImportState.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTImportState.java
index ac1487ac..c4fae0e1 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTImportState.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTImportState.java
@@ -38,6 +38,8 @@ public class IAPTImportState extends SimpleExcelTaxonImportState<IAPTImportConfi
 
 	private final Map<String, UUID> higherTaxonUuidMap = new HashMap<String, UUID>();
 
+    private final Map<String, Taxon> genusTaxonMap = new HashMap<String, Taxon>();
+
 	private final Map<String, BotanicalName> familyNameMap = new HashMap<String, BotanicalName>();
 
 	//classification
@@ -96,15 +98,10 @@ public class IAPTImportState extends SimpleExcelTaxonImportState<IAPTImportConfi
         return higherTaxonUuidMap.containsKey(higherName);
     }
 
-    //family names
-    public BotanicalName getFamilyName(String familyStr) {
-        return familyNameMap.get(familyStr);
-    }
-    public void putFamilyName(String familyStr, BotanicalName name) {
-        familyNameMap.put(familyStr, name);
+    public Map<String, Taxon> getGenusTaxonMap() {
+        return genusTaxonMap;
     }
 
-
     Map<UUID, Reference> refMap = new HashMap<UUID, Reference>();
     //reference
     public Reference getReference(UUID uuidRef) {
