commit 6a915f5e6fbad94ef907180d7cdf1ee5a4ca02d4
Author: Andreas Müller <a.mueller@bgbm.org>
Date:   Mon Mar 26 09:03:29 2012 +0000

    moved vibrant to app-import

diff --git a/.gitattributes b/.gitattributes
index c215fa42..ed13cb97 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -69,6 +69,9 @@ app-import/src/main/java/eu/etaxonomy/cdm/app/tcs/TcsSources.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/tcs/TcsXmlTestActivator.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/util/TestDatabase.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/util/TestTransaction.java -text
+app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/IopiActivator.java -text
+app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/MclActivator.java -text
+app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/VibrantActivator.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/viennaImport/ViennaActivator.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/wp6/cichorieae/CichorieaeActivator.java -text
 app-import/src/main/java/eu/etaxonomy/cdm/app/wp6/cichorieae/CichorieaeCacheUpdater.java -text
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/IopiActivator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/IopiActivator.java
new file mode 100644
index 00000000..9c14427c
--- /dev/null
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/IopiActivator.java
@@ -0,0 +1,201 @@
+/**
+* Copyright (C) 2007 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.vibrant;
+
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.app.common.BerlinModelSources;
+import eu.etaxonomy.cdm.app.common.CdmDestinations;
+import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator;
+import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.EDITOR;
+import eu.etaxonomy.cdm.io.common.Source;
+import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+
+
+/**
+ * TODO add the following to a wiki page:
+ * HINT: If you are about to import into a mysql data base running under windows and if you wish to dump and restore the resulting data bas under another operation systen 
+ * you must set the mysql system variable lower_case_table_names = 0 in order to create data base with table compatible names.
+ * 
+ * 
+ * @author a.mueller
+ *
+ */
+public class IopiActivator {
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(IopiActivator.class);
+
+	//database validation status (create, update, validate ...)
+	static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
+	static final Source berlinModelSource = BerlinModelSources.iopi();
+	
+//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
+	static final ICdmDataSource cdmDestination = cdm_test_local_iopi();
+	
+	static final boolean useSingleClassification = false;
+	static final Integer sourceSecId = null; //7000000; 
+	static final UUID classificationUuid = null; //UUID.fromString("aa3fbaeb-f5dc-4e75-8d60-c8f93beb7ba6");
+	
+	static final UUID sourceRefUuid = UUID.fromString("df68c748-3c64-4b96-9a47-db51fb9d387e");
+	
+	// set to zero for unlimited nameFacts
+	static final int maximumNumberOfNameFacts = 0;
+	
+	static final int partitionSize = 1500;
+	
+	//check - import
+	static final CHECK check = CHECK.CHECK_AND_IMPORT;
+
+	//editor - import
+	static final EDITOR editor = EDITOR.EDITOR_AS_EDITOR;
+	
+	//NomeclaturalCode
+	static final NomenclaturalCode nomenclaturalCode = NomenclaturalCode.ICBN;
+
+	//ignore null
+	static final boolean ignoreNull = true;
+	
+	static boolean useClassification = true;
+	
+	
+// **************** ALL *********************	
+
+	//authors
+	static final boolean doAuthors = true;
+	//references
+	static final DO_REFERENCES doReferences =  DO_REFERENCES.ALL;
+	//names
+	static final boolean doTaxonNames = true;
+	static final boolean doRelNames = true;
+	static final boolean doNameStatus = true;
+	
+	//taxa
+	static final boolean doTaxa = true;
+	static final boolean doRelTaxa = true;
+	static final boolean doFacts = true;
+
+	//etc.
+
+	
+// **************** SELECTED *********************
+
+//	static final boolean doUser = true;
+//	//authors
+//	static final boolean doAuthors = false;
+//	//references
+//	static final DO_REFERENCES doReferences =  DO_REFERENCES.NONE;
+//	//names
+//	static final boolean doTaxonNames = false;
+//	static final boolean doRelNames = false;
+//	static final boolean doNameStatus = false;
+//	static final boolean doTypes = false;
+//	static final boolean doNameFacts = false;
+//	
+//	//taxa 
+//	static final boolean doTaxa = false;
+//	static final boolean doRelTaxa = false;
+//	static final boolean doFacts = false;
+//	
+//	//etc.
+//	static final boolean doMarker = false;
+
+	
+//******** ALWAYS IGNORE *****************************
+	
+	static final boolean doUser = false;
+	static final boolean doOccurences = false;
+	static final boolean doCommonNames = false;
+	static final boolean doTypes = false;  
+	static final boolean doNameFacts = false;
+	static final boolean doMarker = false;
+
+	
+	public void importIopi (Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){
+		System.out.println("Start import from BerlinModel("+ berlinModelSource.getDatabase() + ") to " + cdmDestination.getDatabase() + " ...");
+		//make BerlinModel Source
+				
+		BerlinModelImportConfigurator config = BerlinModelImportConfigurator.NewInstance(source,  destination);
+		
+		config.setClassificationUuid(classificationUuid);
+		config.setSourceSecId(sourceSecId);
+		
+		config.setNomenclaturalCode(nomenclaturalCode);
+
+		config.setIgnoreNull(ignoreNull);
+		config.setDoAuthors(doAuthors);
+		config.setDoReferences(doReferences);
+		config.setDoTaxonNames(doTaxonNames);
+		config.setDoRelNames(doRelNames);
+		config.setDoNameStatus(doNameStatus);
+		config.setDoTypes(doTypes);
+		config.setDoNameFacts(doNameFacts);
+		config.setUseClassification(useClassification);
+		config.setSourceRefUuid(sourceRefUuid);
+		
+		config.setDoTaxa(doTaxa);
+		config.setDoRelTaxa(doRelTaxa);
+		config.setDoFacts(doFacts);
+		config.setDoOccurrence(doOccurences);
+		config.setDoCommonNames(doCommonNames);
+		
+		config.setDoMarker(doMarker);
+		config.setDoUser(doUser);
+		config.setEditor(editor);
+		config.setDbSchemaValidation(hbm2dll);
+		
+		// maximum number of name facts to import
+		config.setMaximumNumberOfNameFacts(maximumNumberOfNameFacts);
+
+		config.setUseSingleClassification(useSingleClassification);
+		
+		config.setCheck(check);
+		config.setEditor(editor);
+		config.setRecordsPerTransaction(partitionSize);
+
+		
+		// invoke import
+		CdmDefaultImport<BerlinModelImportConfigurator> bmImport = new CdmDefaultImport<BerlinModelImportConfigurator>();
+		bmImport.invoke(config);
+		
+		System.out.println("End import from BerlinModel ("+ source.getDatabase() + ")...");
+		
+	}
+	
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		IopiActivator importActivator = new IopiActivator();
+		Source source = berlinModelSource;
+		ICdmDataSource cdmRepository = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
+		
+		importActivator.importIopi(source, cdmRepository, hbm2dll);
+
+	}
+	
+	public static ICdmDataSource cdm_test_local_iopi(){
+		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
+		String cdmServer = "127.0.0.1";
+		String cdmDB = "iopi"; 
+		String cdmUserName = "root";
+		return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
+	}
+	
+
+}
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/MclActivator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/MclActivator.java
new file mode 100644
index 00000000..5e0edd20
--- /dev/null
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/MclActivator.java
@@ -0,0 +1,197 @@
+/**
+* Copyright (C) 2007 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.vibrant;
+
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.app.common.BerlinModelSources;
+import eu.etaxonomy.cdm.app.common.CdmDestinations;
+import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator;
+import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.EDITOR;
+import eu.etaxonomy.cdm.io.common.Source;
+import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+
+
+/**
+ * TODO add the following to a wiki page:
+ * HINT: If you are about to import into a mysql data base running under windows and if you wish to dump and restore the resulting data bas under another operation systen 
+ * you must set the mysql system variable lower_case_table_names = 0 in order to create data base with table compatible names.
+ * 
+ * 
+ * @author a.mueller
+ *
+ */
+public class MclActivator {
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(MclActivator.class);
+
+	//database validation status (create, update, validate ...)
+	static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
+	static final Source berlinModelSource = BerlinModelSources.mcl();
+	
+	static final ICdmDataSource cdmDestination = cdm_test_local_mcl();
+//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
+	
+	static final boolean useSingleClassification = true;
+	static final int sourceSecId = 1272;
+	static final UUID classificationUuid = UUID.fromString("ba6efd26-5b45-4ce6-915d-4f9576e0bf0a");
+	
+	static final UUID sourceRefUuid = UUID.fromString("ca8b25d6-e251-4d2b-8b45-142e1e6448f7");
+	
+	// set to zero for unlimited nameFacts
+	static final int maximumNumberOfNameFacts = 0;
+	
+	static final int partitionSize = 5000;
+	
+	//check - import
+	static final CHECK check = CHECK.CHECK_AND_IMPORT;
+
+	//editor - import
+	static final EDITOR editor = EDITOR.EDITOR_AS_EDITOR;
+	
+	//NomeclaturalCode
+	static final NomenclaturalCode nomenclaturalCode = NomenclaturalCode.ICBN;
+
+	//ignore null
+	static final boolean ignoreNull = true;
+	
+	static boolean useClassification = true;
+	
+	
+// **************** ALL *********************	
+
+
+	//authors
+	static final boolean doAuthors = true;
+	//references
+	static final DO_REFERENCES doReferences =  DO_REFERENCES.ALL;
+	//names
+	static final boolean doTaxonNames = true;
+	static final boolean doRelNames = true;
+	static final boolean doNameStatus = true;
+	
+	//taxa
+	static final boolean doTaxa = true;
+	static final boolean doRelTaxa = true;
+	static final boolean doFacts = true;
+
+
+	
+// **************** SELECTED *********************
+
+//	//authors
+//	static final boolean doAuthors = false;
+//	//references
+//	static final DO_REFERENCES doReferences =  DO_REFERENCES.NONE;
+//	//names
+//	static final boolean doTaxonNames = false;
+//	static final boolean doRelNames = false;
+//	static final boolean doNameStatus = false;
+//	
+//	//taxa 
+//	static final boolean doTaxa = false;
+//	static final boolean doRelTaxa = true;
+//	static final boolean doFacts = false;
+
+	
+	
+// **********Always IGNORE:***********************************************
+	
+	//etc.
+	static final boolean doUser = false;
+	static final boolean doTypes = false;   //not available in MCL
+	static final boolean doNameFacts = false;  //not available in MCL
+	static final boolean doOccurences = false;     //not available in MCL
+	static final boolean doCommonNames = false;   //not available in MCL
+	static final boolean doMarker = false;   //not available in MCL
+	
+	
+	public void importMcl (Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){
+		System.out.println("Start import from BerlinModel("+ berlinModelSource.getDatabase() + ") to " + cdmDestination.getDatabase() + " ...");
+		//make BerlinModel Source
+				
+		BerlinModelImportConfigurator config = BerlinModelImportConfigurator.NewInstance(source,  destination);
+		
+		config.setClassificationUuid(classificationUuid);
+		config.setSourceSecId(sourceSecId);
+		
+		config.setNomenclaturalCode(nomenclaturalCode);
+
+		config.setIgnoreNull(ignoreNull);
+		config.setDoAuthors(doAuthors);
+		config.setDoReferences(doReferences);
+		config.setDoTaxonNames(doTaxonNames);
+		config.setDoRelNames(doRelNames);
+		config.setDoNameStatus(doNameStatus);
+		config.setDoTypes(doTypes);
+		config.setDoNameFacts(doNameFacts);
+		config.setUseClassification(useClassification);
+		config.setSourceRefUuid(sourceRefUuid);
+		
+		config.setDoTaxa(doTaxa);
+		config.setDoRelTaxa(doRelTaxa);
+		config.setDoFacts(doFacts);
+		config.setDoOccurrence(doOccurences);
+		config.setDoCommonNames(doCommonNames);
+		
+		config.setDoMarker(doMarker);
+		config.setDoUser(doUser);
+		config.setEditor(editor);
+		config.setDbSchemaValidation(hbm2dll);
+		
+		// maximum number of name facts to import
+		config.setMaximumNumberOfNameFacts(maximumNumberOfNameFacts);
+
+		config.setUseSingleClassification(useSingleClassification);
+
+		
+		config.setCheck(check);
+		config.setEditor(editor);
+		config.setRecordsPerTransaction(partitionSize);
+
+		
+		// invoke import
+		CdmDefaultImport<BerlinModelImportConfigurator> bmImport = new CdmDefaultImport<BerlinModelImportConfigurator>();
+		bmImport.invoke(config);
+		
+		System.out.println("End import from BerlinModel ("+ source.getDatabase() + ")...");
+		
+	}
+	
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		MclActivator importActivator = new MclActivator();
+		Source source = berlinModelSource;
+		ICdmDataSource cdmRepository = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
+		
+		importActivator.importMcl(source, cdmRepository, hbm2dll);
+
+	}
+	
+	public static ICdmDataSource cdm_test_local_mcl(){
+		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
+		String cdmServer = "127.0.0.1";
+		String cdmDB = "mcl"; 
+		String cdmUserName = "root";
+		return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
+	}
+
+}
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/VibrantActivator.java b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/VibrantActivator.java
new file mode 100644
index 00000000..c71862d0
--- /dev/null
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/app/vibrant/VibrantActivator.java
@@ -0,0 +1,93 @@
+/**
+* Copyright (C) 2007 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.vibrant;
+
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.app.common.BerlinModelSources;
+import eu.etaxonomy.cdm.app.common.CdmDestinations;
+import eu.etaxonomy.cdm.app.pesi.EuroMedActivator;
+import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator;
+import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.EDITOR;
+import eu.etaxonomy.cdm.io.common.Source;
+import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+
+
+/**
+ * TODO add the following to a wiki page:
+ * HINT: If you are about to import into a mysql data base running under windows and if you wish to dump and restore the resulting data bas under another operation systen 
+ * you must set the mysql system variable lower_case_table_names = 0 in order to create data base with table compatible names.
+ * 
+ * 
+ * @author a.mueller
+ *
+ */
+public class VibrantActivator {
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(VibrantActivator.class);
+
+	//database validation status (create, update, validate ...)
+	static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
+	static final Source iopiSource = BerlinModelSources.iopi();
+	static final Source mclSource = BerlinModelSources.mcl();
+	static final Source emSource = BerlinModelSources.euroMed_local();
+	
+//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
+	static final ICdmDataSource cdmDestination = cdm_test_local_vibrant();
+
+	static final boolean doMcl = true;
+	static final boolean doEuroMed = false;
+	static final boolean doIopi = true;
+	
+	
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		ICdmDataSource cdmRepository = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
+		
+		if (doMcl){
+			MclActivator mclActivator = new MclActivator();
+			mclActivator.importMcl(mclSource, cdmRepository, hbm2dll);
+			hbm2dll = DbSchemaValidation.NONE;
+		}
+		
+		if (doEuroMed){
+			EuroMedActivator emActivator = new EuroMedActivator();
+			emActivator.importEm2CDM(emSource, cdmRepository, hbm2dll);
+			hbm2dll = DbSchemaValidation.NONE;
+		}
+		
+		if (doIopi){
+			IopiActivator iopiActivator = new IopiActivator();
+			iopiActivator.importIopi(iopiSource, cdmRepository, hbm2dll);
+			hbm2dll = DbSchemaValidation.NONE;
+		}
+
+	}
+	
+	public static ICdmDataSource cdm_test_local_vibrant(){
+		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
+		String cdmServer = "127.0.0.1";
+		String cdmDB = "vibrant"; 
+		String cdmUserName = "root";
+		return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
+	}
+
+}
