commit f75416985aa89d582fe8211398132e29d329b610
Author: Andreas Müller <a.mueller@bgbm.org>
Date:   Thu Jan 25 15:08:35 2018 +0100

    ref #7216 use pteridophyta (not spermatophyta) and remove unused alternative family implementations for Cuba import

diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/common/tasks/Deduplicator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/common/tasks/Deduplicator.java
new file mode 100644
index 00000000..04f50b5e
--- /dev/null
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/common/tasks/Deduplicator.java
@@ -0,0 +1,81 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* 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.app.common.tasks;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
+import eu.etaxonomy.cdm.app.common.CdmDestinations;
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.reference.Reference;
+
+/**
+ * Deduplicates certain classes.
+ *
+ * CAUTION: Deduplicating teams does not yet work correctly. Team members are often duplicated.
+ *
+ * @author a.mueller
+ * @date 24.11.2017
+ *
+ */
+public class Deduplicator {
+    @SuppressWarnings("unused")
+    private static final Logger logger = Logger.getLogger(Deduplicator.class);
+
+    //database validation status (create, update, validate ...)
+//  static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE;
+//  static final ICdmDataSource cdmDestination = CdmDestinations.cdm_production_cichorieae();
+//  static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
+    static final ICdmDataSource cdmDestination = CdmDestinations.cdm_production_caryophyllales_spp();
+//  static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_caryo_spp();
+
+
+
+   static boolean doPersons = false;
+   static boolean doTeams = true;
+   static boolean doReferences = false;
+
+
+    private void doInvoke(ICdmDataSource destination){
+
+        try {
+            CdmApplicationController app = CdmApplicationController.NewInstance(destination, DbSchemaValidation.VALIDATE);
+
+            if (doPersons){
+                app.getAgentService().deduplicate(Person.class, null, null);
+            }
+            if (doTeams){
+                app.getAgentService().deduplicate(Team.class, null, null);
+            }
+            if (doReferences){
+                app.getReferenceService().deduplicate(Reference.class, null, null);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        ICdmDataSource destination = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
+
+        System.out.println("Start updating caches for "+ destination.getDatabase() + "...");
+        Deduplicator me = new Deduplicator();
+        me.doInvoke(destination);
+        System.exit(0);
+
+    }
+}
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/redlist/BfnXmlImportActivator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/redlist/BfnXmlImportActivator.java
index 548fb150..83f4097a 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/app/redlist/BfnXmlImportActivator.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/redlist/BfnXmlImportActivator.java
@@ -9,29 +9,6 @@
 
 package eu.etaxonomy.cdm.app.redlist;
 
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand1_kriechtiere;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand1_lurche;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand1_saeugetiere;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand1_suessfische;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand2_bodenlebendenWirbellosenMeerestiere;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand2_meeresfischeUndNeunaugen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_ameisen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_bienen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_binnenmollusken;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_eulenfalter;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_fransenfluegler;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_heuschrecken;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_ohrwuermer;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_pflanzenwespen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_raubfliegen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_schaben;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_schwebfliegen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_spanner;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_spinner;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_tagfalter;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_tanzfliegen;
-import static eu.etaxonomy.cdm.io.redlist.bfnXml.in.BfnXmlImportReferences.uuidBand3_zuenslerfalter;
-
 import java.net.URI;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -68,8 +45,8 @@ public class BfnXmlImportActivator {
 //	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_redlist_plant_localhost();
 //	static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
 //	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
-//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_redlist_animalia_production_final();
-    static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_redlist_mammalia();
+	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_redlist_animalia_production_final();
+//    static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_redlist_mammalia();
 
 	private static final String sourceUriBase = "file:////BGBM-PESIHPC/RoteListen/RoteListenXml/";
 
@@ -153,61 +130,61 @@ public class BfnXmlImportActivator {
 //				"rldb_print_v4_0_1_0_Myxo_110708_korr_syn_neu.xml",uuidBand6_myxomyzeten.toString(),
 //
 //				Animals
-		        //band1
-				"rldb_print_v4_0_1_0_Brutvoegel.xml",BfnXmlImportReferences.uuidBand1_brutvoegel.toString(), //Brutvögel
-				"rldb_print_v4_0_1_0_Reptilien_1.xml",uuidBand1_kriechtiere.toString(),
-                "rldb_print_v4_0_1_0_Amphibien.xml",uuidBand1_lurche.toString(),  //Kriechtiere
-                "RoteListe_v4_0_6_0_BFN_Saeuger_korr.xml",uuidBand1_saeugetiere.toString(), //Säugetiere
-                "rldb_print_v4_0_1_0_Fische.xml",uuidBand1_suessfische.toString(),
-                //
-		        //band2
-		        "rldb_print_v4_0_1_0_artenarmeWeichtiergruppen_121127_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Asselspinnen_120907_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Flohkrebse_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Igelwuermer_120907_verantw.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Kumazeen_120709_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Asseln_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Moostierchen_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Muscheln_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Schnecken_130206_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Meeresfische_syn.xml",uuidBand2_meeresfischeUndNeunaugen.toString(),
-		        "rldb_print_v4_0_1_0_Nesseltiere_130104_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Schaedellose_120907_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Schädellose
-		        "rldb_print_v4_0_1_0_Schwaemme_121127_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Schwämme
-		        "rldb_print_v4_0_1_0_Seepocken_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Seescheiden_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Stachelhaeuter_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Stachelhäuter
-		        "rldb_print_v4_0_1_0_Vielborster_130206_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Wenigborster_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        "rldb_print_v4_0_1_0_Zehnfusskrebse_130104_verantw_syn.xml", uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
-		        //
-		        //band3
-			    "rldb_print_v4_0_1_0_Ameisen_110609_rev120113_syn.xml", uuidBand3_ameisen.toString(), //Hymenoptera: Formicidae
-			    "rldb_print_v4_0_1_0_Bienen_PWKorr_HG_120413_DF_120612_syn.xml",uuidBand3_bienen.toString(),  //Hymnenoptera: Apidae
-			    "rldb_print_v4_0_1_0_Binnenmollusken_0alle_120413_DF_syn.xml",uuidBand3_binnenmollusken.toString(),
-			    //eulenfalter - korrekt?
-			    "rldb_print_v4_0_1_0_Eulen_Korruebern_23-05-2012_KorrV_syn.xml",uuidBand3_eulenfalter.toString(), //Eulen & Korrübern
-			    "rldb_print_v4_0_1_0_Thysanoptera_120413_DF_korrV_Verantw.xml",uuidBand3_fransenfluegler.toString(),
-			    "rldb_print_v4_0_1_0_Heuschrecken_syn.xml",uuidBand3_heuschrecken.toString(),  //Saltatoria
-			    "rldb_print_v4_0_1_0_Ohrwuermer_DF_syn.xml",uuidBand3_ohrwuermer.toString(),   //Dermaptera
-			    "rldb_print_v4_0_1_0_Pflanzenwespen_280711_Autor_110815_HG2_120413_DF_syn.xml",uuidBand3_pflanzenwespen.toString(), //Hymenoptera: Symphata
-			    "rldb_print_v4_0_1_0_Asilidae_GMH_Wolff_110314_HGxls_120413_DF_korrV_Verantw_syn.xml",uuidBand3_raubfliegen.toString(),
-			    "rldb_print_v4_0_1_0_Blattoptera_140413_DF_syn.xml",uuidBand3_schaben.toString(),
-			    "rldb_print_v4_0_1_0_Schwebfliegen_111103_KorrAS_120413_DF_syn.xml",uuidBand3_schwebfliegen.toString(), //Diptera: Syrphidae
-			    //spanner - korrekt?
-				"rldb_print_v4_0_1_0_Eulenspinner_Spanner_13-06-2012_KorrV_syn.xml",uuidBand3_spanner.toString(), //Eulenspinner & Spanner
-			    "rldb_print_v4_0_1_0_Spinner_Oktober2011_eingearbKorr_120124_Korruebern_MB_02-05-2012_KorrV_syn.xml",uuidBand3_spinner.toString(),
-			    "rldb_print_v4_0_1_0_Tagfalter_06-06-2012_KorrV_syn.xml",uuidBand3_tagfalter.toString(),
-			    "rldb_print_v4_0_1_0_Empidoidea_120413_DF.xml",uuidBand3_tanzfliegen.toString(),  //Empidoidea
-			    //wespen - fehlen ????? => siehe auch titel des Referenz Word Files
-			    "rldb_print_v4_0_1_0_Pyraloidea_Februar_2012_Korruebern_MB_24-04-2012_syn.xml",uuidBand3_zuenslerfalter.toString()
+//		        //band1
+//				"rldb_print_v4_0_1_0_Brutvoegel.xml",BfnXmlImportReferences.uuidBand1_brutvoegel.toString(), //Brutvögel
+//				"rldb_print_v4_0_1_0_Reptilien_1.xml",uuidBand1_kriechtiere.toString(),
+//                "rldb_print_v4_0_1_0_Amphibien.xml",uuidBand1_lurche.toString(),  //Kriechtiere
+//                "RoteListe_v4_0_6_0_BFN_Saeuger_korr.xml",uuidBand1_saeugetiere.toString(), //Säugetiere
+//                "rldb_print_v4_0_1_0_Fische.xml",uuidBand1_suessfische.toString(),
+//                //
+//		        //band2
+//		        "rldb_print_v4_0_1_0_artenarmeWeichtiergruppen_121127_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Asselspinnen_120907_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Flohkrebse_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Igelwuermer_120907_verantw.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Kumazeen_120709_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Asseln_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Moostierchen_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Muscheln_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Schnecken_130206_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Meeresfische_syn.xml",uuidBand2_meeresfischeUndNeunaugen.toString(),
+//		        "rldb_print_v4_0_1_0_Nesseltiere_130104_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Schaedellose_120907_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Schädellose
+//		        "rldb_print_v4_0_1_0_Schwaemme_121127_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Schwämme
+//		        "rldb_print_v4_0_1_0_Seepocken_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Seescheiden_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Stachelhaeuter_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(), //Stachelhäuter
+//		        "rldb_print_v4_0_1_0_Vielborster_130206_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Wenigborster_121128_verantw_syn.xml",uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        "rldb_print_v4_0_1_0_Zehnfusskrebse_130104_verantw_syn.xml", uuidBand2_bodenlebendenWirbellosenMeerestiere.toString(),
+//		        //
+//		        //band3
+//			    "rldb_print_v4_0_1_0_Ameisen_110609_rev120113_syn.xml", uuidBand3_ameisen.toString(), //Hymenoptera: Formicidae
+//			    "rldb_print_v4_0_1_0_Bienen_PWKorr_HG_120413_DF_120612_syn.xml",uuidBand3_bienen.toString(),  //Hymnenoptera: Apidae
+//			    "rldb_print_v4_0_1_0_Binnenmollusken_0alle_120413_DF_syn.xml",uuidBand3_binnenmollusken.toString(),
+//			    //eulenfalter - korrekt?
+//			    "rldb_print_v4_0_1_0_Eulen_Korruebern_23-05-2012_KorrV_syn.xml",uuidBand3_eulenfalter.toString(), //Eulen & Korrübern
+//			    "rldb_print_v4_0_1_0_Thysanoptera_120413_DF_korrV_Verantw.xml",uuidBand3_fransenfluegler.toString(),
+//			    "rldb_print_v4_0_1_0_Heuschrecken_syn.xml",uuidBand3_heuschrecken.toString(),  //Saltatoria
+//			    "rldb_print_v4_0_1_0_Ohrwuermer_DF_syn.xml",uuidBand3_ohrwuermer.toString(),   //Dermaptera
+//			    "rldb_print_v4_0_1_0_Pflanzenwespen_280711_Autor_110815_HG2_120413_DF_syn.xml",uuidBand3_pflanzenwespen.toString(), //Hymenoptera: Symphata
+//			    "rldb_print_v4_0_1_0_Asilidae_GMH_Wolff_110314_HGxls_120413_DF_korrV_Verantw_syn.xml",uuidBand3_raubfliegen.toString(),
+//			    "rldb_print_v4_0_1_0_Blattoptera_140413_DF_syn.xml",uuidBand3_schaben.toString(),
+//			    "rldb_print_v4_0_1_0_Schwebfliegen_111103_KorrAS_120413_DF_syn.xml",uuidBand3_schwebfliegen.toString(), //Diptera: Syrphidae
+//			    //spanner - korrekt?
+//				"rldb_print_v4_0_1_0_Eulenspinner_Spanner_13-06-2012_KorrV_syn.xml",uuidBand3_spanner.toString(), //Eulenspinner & Spanner
+//			    "rldb_print_v4_0_1_0_Spinner_Oktober2011_eingearbKorr_120124_Korruebern_MB_02-05-2012_KorrV_syn.xml",uuidBand3_spinner.toString(),
+//			    "rldb_print_v4_0_1_0_Tagfalter_06-06-2012_KorrV_syn.xml",uuidBand3_tagfalter.toString(),
+//			    "rldb_print_v4_0_1_0_Empidoidea_120413_DF.xml",uuidBand3_tanzfliegen.toString(),  //Empidoidea
+//			    //wespen - fehlen ????? => siehe auch titel des Referenz Word Files
+//			    "rldb_print_v4_0_1_0_Pyraloidea_Februar_2012_Korruebern_MB_24-04-2012_syn.xml",uuidBand3_zuenslerfalter.toString()
 
 
 //		        //the 4 first lists, THESE ARE DUPLICATES
-//		        "RoteListe_v4_0_6_0_BFN_Saeuger_korr.xml",
-//                "rldb_print_v4_0_1_0_Amphibien.xml",
-//                "rldb_print_v4_0_1_0_Reptilien_1.xml",
-//                "rldb_print_v4_0_1_0_Heuschrecken_syn.xml"
+//		        "RoteListe_v4_0_6_0_BFN_Saeuger_korr.xml",BfnXmlImportReferences.uuidBand1_saeugetiere.toString(),
+                "rldb_print_v4_0_1_0_Amphibien.xml",BfnXmlImportReferences.uuidBand1_lurche.toString(),
+                "rldb_print_v4_0_1_0_Reptilien_1.xml",BfnXmlImportReferences.uuidBand1_kriechtiere.toString(),
+                "rldb_print_v4_0_1_0_Heuschrecken_syn.xml", BfnXmlImportReferences.uuidBand3_heuschrecken.toString()
 
 				);
 
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/cuba/CubaExcelImport.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/cuba/CubaExcelImport.java
index 47decc93..d9e9fc59 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/cuba/CubaExcelImport.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/cuba/CubaExcelImport.java
@@ -36,7 +36,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.OriginalSourceType;
-import eu.etaxonomy.cdm.model.common.Representation;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.description.Distribution;
@@ -44,7 +43,6 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TaxonInteraction;
-import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.IBotanicalName;
@@ -87,6 +85,7 @@ public class CubaExcelImport
 
     private static UUID rootUuid = UUID.fromString("206d42e4-ac32-4f20-a093-14826014e667");
     private static UUID spermatophytaUuid = UUID.fromString("139e7314-dd19-4286-a01d-8cc94ef77a09");
+    private static UUID pteridophytaUuid = UUID.fromString("cd2a7c42-4e2b-4a42-8044-18c8e3ccb76d");
 
     private static INonViralNameParser<?> nameParser = NonViralNameParserImpl.NewInstance();
     private static NomenclaturalCode nc = NomenclaturalCode.ICNAFP;
@@ -1323,7 +1322,7 @@ public class CubaExcelImport
         }
         TaxonNode rootNode = state.getRootNode();
         if (rootNode == null){
-            rootNode = getTaxonNodeService().find(spermatophytaUuid);
+            rootNode = getTaxonNodeService().find(pteridophytaUuid);
         }
         if (rootNode == null){
             Reference sec = getSecReference(state);
@@ -1570,10 +1569,10 @@ public class CubaExcelImport
 
         TaxonDescription desc = getTaxonDescription(taxon, false, true);
 
-        UUID altFamUuid1;
+//        UUID altFamUuid1;
         UUID altFamUuid2;
         try {
-            altFamUuid1 = state.getTransformer().getFeatureUuid("Alt.Fam.");
+//            altFamUuid1 = state.getTransformer().getFeatureUuid("Alt.Fam.");
             altFamUuid2 = state.getTransformer().getFeatureUuid("Alt.Fam.2");
         } catch (UndefinedTransformerMethodException e) {
             throw new RuntimeException(e);
@@ -1583,28 +1582,29 @@ public class CubaExcelImport
         Taxon famTaxon = makeAlternativeFamilyTaxon(state, famStr, famRef);
 
 
-        //TextData
-        Feature feature1 = getFeature(state, altFamUuid1, "Families in other Floras (Text)", "Families in other Floras (Text)", "Other floras", null);
-        feature1.addRepresentation(Representation.NewInstance("Familias en otras Floras", "Familias en otras Floras", null, Language.SPANISH_CASTILIAN()));
-//        TextData textData = TextData.NewInstance(feature1, famStr, Language.DEFAULT(), null);
-        TextData textData = TextData.NewInstance(feature1, null, Language.DEFAULT(), null);
-        textData.addSource(OriginalSourceType.PrimaryTaxonomicSource, null,null, famRef, null, famTaxon.getName(),null);
-        desc.addElement(textData);
+        //TextData  //not used anymore
+//        Feature feature1 = getFeature(state, altFamUuid1, "Families in other Floras (Text)", "Families in other Floras (Text)", "Other floras", null);
+//        feature1.addRepresentation(Representation.NewInstance("Familias en otras Floras", "Familias en otras Floras", null, Language.SPANISH_CASTILIAN()));
+////        TextData textData = TextData.NewInstance(feature1, famStr, Language.DEFAULT(), null);
+//        TextData textData = TextData.NewInstance(feature1, null, Language.DEFAULT(), null);
+//        textData.putText(Language.SPANISH_CASTILIAN(), "Familias en otras Floras");
+//        textData.addSource(OriginalSourceType.PrimaryTaxonomicSource, null,null, famRef, null, famTaxon.getName(),null);
+//        desc.addElement(textData);
 
 
 
         //TaxonInteraction
-        Feature feature2 = getFeature(state, altFamUuid2, "Families in other Floras", "Families in other Floras", "Other floras(2)", null);
-        feature2.setSupportsTaxonInteraction(true);
-        feature2.addRepresentation(Representation.NewInstance("Familias en otras Floras", "Familias en otras Floras", null, Language.SPANISH_CASTILIAN()));
+        Feature feature2 = getFeature(state, altFamUuid2, "Families in other Floras", "Families in other Floras", "Other floras", null);
+        //feature should exist already
+//        feature2.setSupportsTaxonInteraction(true);
+//        feature2.addRepresentation(Representation.NewInstance("Familias en otras Floras", "Familias en otras Floras", null, Language.SPANISH_CASTILIAN()));
         TaxonInteraction taxInteract = TaxonInteraction.NewInstance(feature2);
-        textData.putText(Language.SPANISH_CASTILIAN(), "Familias en otras Floras");
         taxInteract.setTaxon2(famTaxon);
         taxInteract.addSource(OriginalSourceType.PrimaryTaxonomicSource, null,null, famRef, null);
         desc.addElement(taxInteract);
 
-        //Concept Relation
-        famTaxon.addTaxonRelation(taxon, TaxonRelationshipType.INCLUDES(), taxon.getSec(), null);
+        //Concept Relation  //not used anymore
+//        famTaxon.addTaxonRelation(taxon, TaxonRelationshipType.INCLUDES(), taxon.getSec(), null);
 
     }
 
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/greece/ImageImportTest.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/greece/ImageImportTest.java
new file mode 100644
index 00000000..90b06c31
--- /dev/null
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/greece/ImageImportTest.java
@@ -0,0 +1,185 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* 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.greece;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+
+import org.apache.http.HttpException;
+import org.apache.log4j.Logger;
+import org.apache.sanselan.ImageReadException;
+import org.apache.sanselan.Sanselan;
+import org.apache.sanselan.common.IImageMetadata;
+import org.apache.sanselan.common.ImageMetadata.Item;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import eu.etaxonomy.cdm.common.media.ImageInfo;
+import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper;
+import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.cdm.model.media.ImageFile;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+/**
+ * @author a.mueller
+ * @date 13.05.2017
+ *
+ */
+public class ImageImportTest {
+
+    @SuppressWarnings("unused")
+    private static final Logger logger = Logger.getLogger(FloraHellenicaImageImport.class);
+
+    private static final String BASE_URL = "https://media.e-taxonomy.eu/flora-greece/";
+    private static final String IMAGE_FOLDER = "////BGBM-PESIHPC/Greece/thumbs/";
+    private ImportDeduplicationHelper deduplicationHelper = null;
+
+    protected void doInvoke() {
+        for (int plate = 1; plate < 22 ; plate++){
+            System.out.println("Plate: " + plate);
+            String fill = plate < 10 ? "0" : "";
+            String plateStr = "Plate_" + fill + plate + "/";
+            String fullFolderUrl = BASE_URL + plateStr;
+            String fullThumbUrl = BASE_URL + "thumbs/" + plateStr;
+            String folderStr = IMAGE_FOLDER + plateStr;
+            File file = new File(folderStr);
+            String[] list = file.list();
+            System.out.println(DateTimeZone.getAvailableIDs());
+            for (String fileStr : list){
+                String[] taxonNameAndArtist = getTaxonName(fileStr);
+                String taxonNameStr = taxonNameAndArtist[0];
+                String artistStr = taxonNameAndArtist[1];
+
+
+                if(false){
+                    continue;
+                }
+                Taxon taxon = getAcceptedTaxon(taxonNameStr);
+                TaxonDescription imageGallery = taxon.getImageGallery(true);
+                TextData textData = TextData.NewInstance();
+
+                URI uri = URI.create(fullFolderUrl + fileStr);
+
+                //image metadata
+                File imageFile = new File("");
+                IImageMetadata metadata;
+                try {
+                    metadata = Sanselan.getMetadata(uri.toURL().openStream(), null);
+                    ArrayList<?> items = metadata.getItems();
+                    for (Object object : items){
+                        Item item = (Item) object;
+                        System.out.println(item.getKeyword() +  ":    " + item.getText());
+                        String value = removeQuots(item.getText());
+                        if("Image Description".equalsIgnoreCase(item.getKeyword())){
+//                          media.putDescription(Language.DEFAULT(), item.getText());
+                        }else if ("date time original".equalsIgnoreCase(item.getKeyword())){
+                            DateTimeFormatter f = DateTimeFormat.forPattern("yyyy:MM:dd HH:mm:ss");
+                            DateTime created = f.withZone(DateTimeZone.forID("Europe/Athens")).parseDateTime(value);
+                            System.out.println(created);
+
+                        }
+                    }
+                } catch (ImageReadException | IOException e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+
+
+
+
+                ImageInfo imageMetaData;
+                try {
+                    imageMetaData = ImageInfo.NewInstance(uri, 0);
+
+                    String mimeType = imageMetaData.getMimeType();
+                    String suffix = null;
+                    int height = imageMetaData.getHeight();
+                    int width = imageMetaData.getWidth();
+                    Integer size = null;
+                    DateTime mediaCreated = null;
+                    AgentBase<?> artist = null;
+                    Media media = ImageFile.NewMediaInstance(mediaCreated, artist, uri, mimeType, suffix, size, height, width);
+
+                    textData.addMedia(media);
+                    imageGallery.addElement(textData);
+                } catch (IOException | HttpException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+
+        }
+    }
+
+    /**
+     * @param text
+     * @return
+     */
+    private String removeQuots(String text) {
+        if (text.startsWith("'") && text.endsWith("'")){
+            return text.substring(1, text.length() -1);
+        }else{
+            return text;
+        }
+    }
+
+    /**
+     * @param taxonNameStr
+     * @return
+     */
+    private Taxon getAcceptedTaxon(String taxonNameStr) {
+        return Taxon.NewInstance(null, null);
+    }
+
+    /**
+     * @param fileStr
+     * @return
+     */
+    private String[] getTaxonName(String fileStr) {
+        String[] result = new String[2];
+        fileStr = fileStr.split("\\.")[0];
+        fileStr = fileStr.replaceAll("[0-9]", "");
+        String[] x = fileStr.split("_");
+        if (x.length == 2){
+            result[1] = x[1];
+        }
+
+        fileStr = splitCamelCase(x[0]);
+        String[] split = fileStr.split(" ");
+        String name = split[0] + " " + split[1].toLowerCase() +
+                (split.length > 2 ? " subsp. " + split[2].toLowerCase() : "");
+        result[0] = name;
+        System.out.println(result[0] + (result[1] != null ?  "   Artist: " + result[1]: ""));
+        return result;
+    }
+
+    //from http://stackoverflow.com/questions/2559759/how-do-i-convert-camelcase-into-human-readable-names-in-java
+    static String splitCamelCase(String s) {
+        return s.replaceAll(
+           String.format("%s",
+//              "(?<=[A-Z])(?=[A-Z][a-z])",
+              "(?<=[^A-Z])(?=[A-Z])"
+//              "(?<=[A-Za-z])(?=[^A-Za-z])"
+           ),
+           " "
+        );
+     }
+
+    public static void main(String[] str){
+        ImageImportTest test = new ImageImportTest();
+        test.doInvoke();
+    }
+}
