(no commit message)
authorKatja Luther <k.luther@bgbm.org>
Tue, 9 Sep 2014 07:38:34 +0000 (07:38 +0000)
committerKatja Luther <k.luther@bgbm.org>
Tue, 9 Sep 2014 07:38:34 +0000 (07:38 +0000)
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/common/CdmDestinations.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/FaunaEuropaeaActivator.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorFE.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorIF.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/indexFungorum/IndexFungorumImportBase.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiDescriptionExport.java
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiExportState.java
cdm-pesi/src/main/resources/log4j.properties

index 9d4cb99fff9020230fb72cf91da8ae7db4a780e9..08ada7b75dac45a553cfc36bea010d76164af5e9 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -26,51 +26,51 @@ public class CdmDestinations {
        public static ICdmDataSource cdm_test_local_mysql(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "cdm_test"; 
+               String cdmDB = "cdm_test";
                String cdmUserName = "root";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
+
        public static ICdmDataSource cdm_test_local_faunaEu_mysql(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "cdm_test"; 
+               String cdmDB = "cdm_faunaeu_2014_07";
                String cdmUserName = "root";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
 
-       
+
        public static ICdmDataSource cdm_test_local_indexFungorum(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "indexFungorum"; 
+               String cdmDB = "indexFungorum";
                String cdmUserName = "root";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
-       
+
+
        public static ICdmDataSource cdm_test_local_mysql_erms(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "erms"; 
+               String cdmDB = "erms";
                String cdmUserName = "root";
                return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
 
-       
+
        public static ICdmDataSource cdm_test_local_mysql_erms2(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "erms2"; 
+               String cdmDB = "erms2";
                String cdmUserName = "root";
                return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
-       
+
+
        public static ICdmDataSource cdm_test_local_mysql_test(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
-               String cdmDB = "test"; 
+               String cdmDB = "test";
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
@@ -81,7 +81,7 @@ public class CdmDestinations {
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
+
        public static ICdmDataSource cdm_portal_test_localhost2(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
@@ -97,26 +97,26 @@ public class CdmDestinations {
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
-       
+
+
        public static ICdmDataSource NULL(){
                return null;
        }
-       
-       
+
+
        public static ICdmDataSource localH2(){
                return CdmDataSource.NewH2EmbeddedInstance("cdm", "sa", "");
        }
-       
+
        public static ICdmDataSource localH2(String database, String username, String filePath){
                return CdmDataSource.NewH2EmbeddedInstance(database, "sa", "", filePath, null);
        }
 
-       
+
        public static ICdmDataSource localH2EuroMed(){
                return CdmDataSource.NewH2EmbeddedInstance("euroMed", "sa", "");
        }
-       
+
        public static ICdmDataSource localH2Erms(){
                return CdmDataSource.NewH2EmbeddedInstance("erms", "sa", "");
        }
@@ -124,7 +124,7 @@ public class CdmDestinations {
        public static ICdmDataSource cdm_algaterra_preview(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "160.45.63.201";
-               String cdmDB = "cdm_edit_algaterra"; 
+               String cdmDB = "cdm_edit_algaterra";
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
@@ -133,7 +133,7 @@ public class CdmDestinations {
        public static ICdmDataSource cdm_pesi_euroMed(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "160.45.63.175";
-               String cdmDB = "cdm_pesi_euromed"; 
+               String cdmDB = "cdm_pesi_euromed";
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
@@ -153,7 +153,7 @@ public class CdmDestinations {
                String cdmUserName = "root";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
+
        public static ICdmDataSource cdm_local_euroMed3(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "127.0.0.1";
@@ -165,25 +165,25 @@ public class CdmDestinations {
        public static ICdmDataSource cdm_pesi_fauna_europaea(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "160.45.63.175";
-               String cdmDB = "cdm_pesi_fauna_europaea"; 
+               String cdmDB = "cdm_pesi_fauna_europaea";
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
-       
+
 
        public static ICdmDataSource cdm_pesi_erms(){
                DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
                String cdmServer = "160.45.63.175";
-               String cdmDB = "cdm_pesi_erms"; 
+               String cdmDB = "cdm_pesi_erms";
                String cdmUserName = "edit";
                return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
        }
 
-        
+
        /**
         * initializes source
         * TODO only supports MySQL and PostgreSQL
-        * 
+        *
         * @param dbType
         * @param cdmServer
         * @param cdmDB
@@ -197,9 +197,9 @@ public class CdmDestinations {
                pwd = AccountStore.readOrStorePassword(cdmServer, cdmDB, cdmUserName, pwd);
                ICdmDataSource destination;
                if(dbType.equals(DatabaseTypeEnum.MySQL)){
-                       destination = CdmDataSource.NewMySqlInstance(cdmServer, cdmDB, port, cdmUserName, pwd, null);                   
+                       destination = CdmDataSource.NewMySqlInstance(cdmServer, cdmDB, port, cdmUserName, pwd, null);
                } else if(dbType.equals(DatabaseTypeEnum.PostgreSQL)){
-                       destination = CdmDataSource.NewPostgreSQLInstance(cdmServer, cdmDB, port, cdmUserName, pwd, null);                      
+                       destination = CdmDataSource.NewPostgreSQLInstance(cdmServer, cdmDB, port, cdmUserName, pwd, null);
                } else {
                        //TODO others
                        throw new RuntimeException("Unsupported DatabaseType");
@@ -210,23 +210,25 @@ public class CdmDestinations {
 
 
        /**
-        * Accepts a string array and tries to find a method returning an ICdmDataSource with 
+        * Accepts a string array and tries to find a method returning an ICdmDataSource with
         * the name of the given first string in the array
-        * 
+        *
         * @param args
         * @return
         */
        public static ICdmDataSource chooseDestination(String[] args) {
-               if(args == null)
-                       return null;
-               
-               if(args.length != 1)
-                       return null;
-               
+               if(args == null) {
+            return null;
+        }
+
+               if(args.length != 1) {
+            return null;
+        }
+
                String possibleDestination = args[0];
-               
+
                Method[] methods = CdmDestinations.class.getMethods();
-               
+
                for (Method method : methods){
                        if(method.getName().equals(possibleDestination)){
                                try {
@@ -245,6 +247,6 @@ public class CdmDestinations {
                }
                return null;
        }
-       
+
 }
 
index 337e4571e6ea29c1dae08978af14f5560168d12a..d1f6637431e3cf94e7b67dae27d3ae89bb5f64e9 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -39,8 +39,9 @@ public class FaunaEuropaeaActivator {
 \r
        static final Source faunaEuropaeaSource = PesiSources.mfn_faunEu_pesi3();\r
        static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_faunaEu_mysql();\r
+       //static final ICdmDataSource cdmDestination = CdmDestinations.cdm_pesi_fauna_europaea();\r
+\r
 \r
-       \r
        static final int limitSave = 5000;\r
 \r
 //     static final CHECK check = CHECK.CHECK_AND_IMPORT;\r
@@ -51,7 +52,7 @@ public class FaunaEuropaeaActivator {
        static final NomenclaturalCode nomenclaturalCode  = NomenclaturalCode.ICZN;\r
 \r
 // ****************** ALL *****************************************\r
-       \r
+\r
        // Fauna Europaea to CDM import\r
        static final boolean doAuthors = true;\r
        static final boolean doTaxa = true;\r
@@ -64,9 +65,9 @@ public class FaunaEuropaeaActivator {
        static final boolean makeFeatureTree = true;\r
     // CDM to CDM import\r
        static final boolean doHeterotypicSynonymsForBasionyms = true;\r
-       \r
+\r
 // ************************ NONE **************************************** //\r
-               \r
+\r
        // Fauna Europaea to CDM import\r
 //     static final boolean doAuthors = false;\r
 //     static final boolean doTaxa = false;\r
@@ -79,21 +80,21 @@ public class FaunaEuropaeaActivator {
 //     static final boolean makeFeatureTree = false;\r
 //    // CDM to CDM import\r
 //     static final boolean doHeterotypicSynonymsForBasionyms = false;\r
-       \r
-       \r
+\r
+\r
        /**\r
         * @param args\r
         */\r
        public static void main(String[] args) {\r
-               \r
+\r
                ICdmDataSource destination = cdmDestination;\r
                System.out.println("Starting import from Fauna Europaea (" + faunaEuropaeaSource.getDatabase() + ") to CDM (" + destination.getDatabase() + ")...");\r
 \r
                                // invoke Fauna Europaea to CDM import\r
-               \r
-               FaunaEuropaeaImportConfigurator fauEuImportConfigurator = \r
+\r
+               FaunaEuropaeaImportConfigurator fauEuImportConfigurator =\r
                        FaunaEuropaeaImportConfigurator.NewInstance(faunaEuropaeaSource,  destination);\r
-               \r
+\r
                fauEuImportConfigurator.setDbSchemaValidation(dbSchemaValidation);\r
                fauEuImportConfigurator.setNomenclaturalCode(nomenclaturalCode);\r
                fauEuImportConfigurator.setCheck(check);\r
@@ -108,8 +109,8 @@ public class FaunaEuropaeaActivator {
                fauEuImportConfigurator.setDoHeterotypicSynonyms(doHeterotypicSynonyms);\r
                fauEuImportConfigurator.setDoHeterotypicSynonymsForBasionyms(doHeterotypicSynonymsForBasionyms);\r
                fauEuImportConfigurator.setSourceRefUuid(PesiTransformer.uuidSourceRefFaunaEuropaea);\r
-               \r
-               CdmDefaultImport<FaunaEuropaeaImportConfigurator> fauEuImport = \r
+\r
+               CdmDefaultImport<FaunaEuropaeaImportConfigurator> fauEuImport =\r
                        new CdmDefaultImport<FaunaEuropaeaImportConfigurator>();\r
                try {\r
                        fauEuImport.invoke(fauEuImportConfigurator);\r
@@ -119,12 +120,12 @@ public class FaunaEuropaeaActivator {
                }\r
 \r
                // invoke CDM to CDM import\r
-               \r
+\r
 //             System.out.println("Starting import from CDM to CDM (" + destination.getDatabase() + ")...");\r
-//             \r
-//             CdmImportConfigurator cdmImportConfigurator = \r
+//\r
+//             CdmImportConfigurator cdmImportConfigurator =\r
 //                     CdmImportConfigurator.NewInstance(destination, destination);\r
-//             \r
+//\r
 //             cdmImportConfigurator.setDbSchemaValidation(DbSchemaValidation.VALIDATE);\r
 //             cdmImportConfigurator.setNomenclaturalCode(nomenclaturalCode);\r
 //             cdmImportConfigurator.setCheck(check);\r
@@ -136,7 +137,7 @@ public class FaunaEuropaeaActivator {
 //             cdmImportConfigurator.setDoOccurrence(false);\r
 //             cdmImportConfigurator.setLimitSave(limitSave);\r
 //\r
-//             CdmDefaultImport<CdmImportConfigurator> cdmImport = \r
+//             CdmDefaultImport<CdmImportConfigurator> cdmImport =\r
 //                     new CdmDefaultImport<CdmImportConfigurator>();\r
 //             try {\r
 //                     cdmImport.invoke(cdmImportConfigurator);\r
@@ -144,10 +145,10 @@ public class FaunaEuropaeaActivator {
 //                     System.out.println("ERROR in CDM to CDM import");\r
 //                     e.printStackTrace();\r
 //             }\r
-               \r
+\r
                //make feature tree\r
-               \r
-               if (makeFeatureTree == true) {\r
+\r
+               if (makeFeatureTree) {\r
                        FeatureTree featureTree = FeatureTree.NewInstance(UUID.fromString("ff59b9ad-1fb8-4aa4-a8ba-79d62123d0fb"));\r
                        FeatureNode root = featureTree.getRoot();\r
 \r
@@ -161,7 +162,7 @@ public class FaunaEuropaeaActivator {
 \r
                        app.getFeatureTreeService().saveOrUpdate(featureTree);\r
                }\r
-               \r
+\r
                System.out.println("End importing Fauna Europaea data");\r
        }\r
 \r
index cf51713a7ce1ed34e791ec2787903a6b570efbfb..5596448c039a5a8992f294476323935be2d9e205 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -34,27 +34,27 @@ public class PesiExportActivatorFE {
        //database validation status (create, update, validate ...)\r
        static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI();\r
 //     static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI();\r
-       \r
+\r
        static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_faunaEu_mysql();\r
 //     static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql();\r
 \r
        //Taxon names can't be mapped to their CDM ids as PESI Taxon table mainly holds taxa and there IDs. We ad nameIdStart to the TaxonName id to get a unique id\r
        static final int nameIdStart = 10000000;\r
-       \r
+\r
        static final int partitionSize = 2000;\r
-       \r
+\r
        //check - export\r
        static final CHECK check = CHECK.EXPORT_WITHOUT_CHECK;\r
 \r
        static final boolean deleteAll = true;\r
-       \r
+\r
        static final IdType idType = IdType.CDM_ID_WITH_EXCEPTIONS;\r
 \r
 // ****************** ALL *****************************************\r
-       \r
+\r
        //references\r
        static final DO_REFERENCES doReferences =  DO_REFERENCES.ALL;\r
-       \r
+\r
        //taxa\r
        static final boolean doTaxa = true;\r
        static final boolean doRelTaxa = true;\r
@@ -69,13 +69,13 @@ public class PesiExportActivatorFE {
        static final boolean doInferredSynonyms = true;\r
        static final boolean doPureNames = false; // !!!\r
        static final boolean doDescription = true;\r
-       \r
+\r
 \r
 // ************************ NONE **************************************** //\r
-       \r
+\r
 //     //references\r
 //     static final DO_REFERENCES doReferences =  DO_REFERENCES.NONE;\r
-//     \r
+//\r
 //     //taxa\r
 //     static final boolean doTaxa = false;\r
 //     static final boolean doRelTaxa = false;\r
@@ -89,17 +89,17 @@ public class PesiExportActivatorFE {
 //     static final boolean doRank = true;\r
 //     static final boolean doInferredSynonyms = true;\r
 //     static final boolean doDescription = false;\r
-       \r
-       \r
+\r
+\r
        public boolean  doExport(ICdmDataSource source){\r
                System.out.println("Start export to PESI ("+ pesiDestination.getDatabase() + ") ...");\r
-               \r
+\r
                //make PESI Source\r
                Source destination = pesiDestination;\r
                PesiTransformer transformer = new PesiTransformer(destination);\r
-               \r
+\r
                PesiExportConfigurator config = PesiExportConfigurator.NewInstance(destination, source, transformer);\r
-               \r
+\r
                config.setDoTaxa(doTaxa);\r
                config.setDoRelTaxa(doRelTaxa);\r
                config.setDoOccurrence(doOccurrence);\r
@@ -113,7 +113,7 @@ public class PesiExportActivatorFE {
                config.setDoInferredSynonyms(doInferredSynonyms);\r
                config.setDoPureNames(doPureNames);\r
                config.setDoDescription(doDescription);\r
-               \r
+\r
                config.setCheck(check);\r
                config.setLimitSave(partitionSize);\r
                config.setIdType(idType);\r
@@ -121,17 +121,17 @@ public class PesiExportActivatorFE {
                if (deleteAll){\r
                        destination.update("EXEC sp_deleteAllData");\r
                }\r
-               \r
+\r
 \r
                // invoke export\r
                CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<PesiExportConfigurator>();\r
-               \r
+\r
                boolean result = pesiExport.invoke(config);\r
-               \r
+\r
                System.out.println("End export to PESI ("+ destination.getDatabase() + ")..." + (result? "(successful)":"(with errors)"));\r
                return result;\r
        }\r
-               \r
+\r
        /**\r
         * @param args\r
         */\r
index 15fb07c12640d5b06646fe887aa61971bfc909f6..a01c65103297ed21917f09e4fb4f109c51a250d3 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -33,24 +33,24 @@ public class PesiExportActivatorIF {
 \r
        //database validation status (create, update, validate ...)\r
        static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_IF2PESI();\r
-       \r
+\r
        static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_indexFungorum();\r
 //     static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_test();\r
 \r
        static final int partitionSize = 2000;\r
-       \r
+\r
        //check - export\r
        static final CHECK check = CHECK.EXPORT_WITHOUT_CHECK;\r
 \r
        static final boolean deleteAll = true;\r
-       \r
+\r
        static final IdType idType = IdType.CDM_ID;\r
 \r
 // ****************** ALL *****************************************\r
-       \r
+\r
        //references\r
        static final DO_REFERENCES doReferences =  DO_REFERENCES.ALL;\r
-       \r
+\r
        //taxa\r
        static final boolean doTaxa = true;\r
        static final boolean doRelTaxa = true;\r
@@ -65,13 +65,13 @@ public class PesiExportActivatorIF {
        static final boolean doInferredSynonyms = false;\r
        static final boolean doPureNames = false; // !!!\r
        static final boolean doDescription = true;\r
-       \r
+\r
 \r
 // ************************ NONE **************************************** //\r
-       \r
+\r
 //     //references\r
 //     static final DO_REFERENCES doReferences =  DO_REFERENCES.NONE;\r
-//     \r
+//\r
 //     //taxa\r
 //     static final boolean doTaxa = false;\r
 //     static final boolean doRelTaxa = false;\r
@@ -85,17 +85,17 @@ public class PesiExportActivatorIF {
 //     static final boolean doRank = true;\r
 //     static final boolean doInferredSynonyms = true;\r
 //     static final boolean doDescription = false;\r
-       \r
-       \r
+\r
+\r
        public boolean  doExport(ICdmDataSource source){\r
                System.out.println("Start export to PESI ("+ pesiDestination.getDatabase() + ") ...");\r
-               \r
+\r
                //make PESI Source\r
                Source destination = pesiDestination;\r
                PesiTransformer transformer = new PesiTransformer(destination);\r
-               \r
+\r
                PesiExportConfigurator config = PesiExportConfigurator.NewInstance(destination, source, transformer);\r
-               \r
+\r
                config.setDoTaxa(doTaxa);\r
                config.setDoRelTaxa(doRelTaxa);\r
                config.setDoOccurrence(doOccurrence);\r
@@ -109,7 +109,7 @@ public class PesiExportActivatorIF {
                config.setDoInferredSynonyms(doInferredSynonyms);\r
                config.setDoPureNames(doPureNames);\r
                config.setDoDescription(doDescription);\r
-               \r
+\r
                config.setCheck(check);\r
                config.setLimitSave(partitionSize);\r
                config.setIdType(idType);\r
@@ -119,12 +119,13 @@ public class PesiExportActivatorIF {
 \r
                // invoke export\r
                CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<PesiExportConfigurator>();\r
-               boolean result = pesiExport.invoke(config);\r
-               \r
+\r
+                   boolean result = pesiExport.invoke(config);\r
+\r
                System.out.println("End export to PESI ("+ destination.getDatabase() + ")..." + (result? "(successful)":"(with errors)"));\r
                return result;\r
        }\r
-               \r
+\r
        /**\r
         * @param args\r
         */\r
index 9fa6c401306379bd6b13aabedab27181128a9ab7..506a017b357612ce61dbb72ee6f2889ad59cd2e2 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -39,7 +39,6 @@ import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.Marker;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.model.common.OriginalSourceType;\r
-import eu.etaxonomy.cdm.model.common.TimePeriod;\r
 import eu.etaxonomy.cdm.model.name.NonViralName;\r
 import eu.etaxonomy.cdm.model.reference.Reference;\r
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;\r
@@ -55,33 +54,33 @@ import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
  */\r
 public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungorumImportConfigurator, IndexFungorumImportState> implements ICdmIO<IndexFungorumImportState>, IPartitionedIO<IndexFungorumImportState> {\r
        private static final Logger logger = Logger.getLogger(IndexFungorumImportBase.class);\r
-       \r
+\r
        //NAMESPACES\r
        protected static final String NAMESPACE_REFERENCE = "reference";\r
        protected static final String NAMESPACE_TAXON = "Taxon";\r
        protected static final String NAMESPACE_SUPRAGENERIC_NAMES = "SupragenericNames";\r
        protected static final String NAMESPACE_GENERA = "Genera";\r
        protected static final String NAMESPACE_SPECIES = "Species";\r
-       \r
-       \r
+\r
+\r
        protected static final String INCERTAE_SEDIS = "Incertae sedis";\r
        protected static final String FOSSIL_FUNGI = "Fossil Fungi";\r
 \r
        protected static final String SOURCE_REFERENCE = "SOURCE_REFERENCE";\r
 \r
 \r
-       \r
 \r
-       private String pluralString;\r
-       private String dbTableName;\r
+\r
+       private final String pluralString;\r
+       private final String dbTableName;\r
        //TODO needed?\r
-       private Class cdmTargetClass;\r
+       private final Class cdmTargetClass;\r
+\r
+\r
 \r
-       \r
-       \r
        /**\r
         * @param dbTableName\r
-        * @param dbTableName2 \r
+        * @param dbTableName2\r
         */\r
        public IndexFungorumImportBase(String pluralString, String dbTableName, Class cdmTargetClass) {\r
                this.pluralString = pluralString;\r
@@ -89,12 +88,15 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                this.cdmTargetClass = cdmTargetClass;\r
        }\r
 \r
-       protected void doInvoke(IndexFungorumImportState state){\r
-               logger.info("start make " + getPluralString() + " ...");\r
+       @Override\r
+    protected void doInvoke(IndexFungorumImportState state){\r
+               System.out.println("start make " + getPluralString() + " ...");\r
                IndexFungorumImportConfigurator config = state.getConfig();\r
                Source source = config.getSource();\r
-                       \r
+\r
+\r
                String strIdQuery = getIdQuery();\r
+\r
                String strRecordQuery = getRecordQuery(config);\r
 \r
                int recordsPerTransaction = config.getRecordsPerTransaction();\r
@@ -108,22 +110,25 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        state.setUnsuccessfull();\r
                        return;\r
                }\r
-               \r
+\r
                logger.info("end make " + getPluralString() + " ... " + getSuccessString(true));\r
                return;\r
        }\r
-       \r
 \r
 \r
-       \r
-       \r
-       public boolean doPartition(ResultSetPartitioner partitioner, IndexFungorumImportState state) {\r
+\r
+\r
+\r
+\r
+\r
+    @Override\r
+    public boolean doPartition(ResultSetPartitioner partitioner, IndexFungorumImportState state) {\r
                boolean success = true ;\r
                Set objectsToSave = new HashSet<CdmBase>();\r
-               \r
+\r
 //             DbImportMapping<?, ?> mapping = getMapping();\r
 //             mapping.initialize(state, cdmTargetClass);\r
-               \r
+\r
                ResultSet rs = partitioner.getResultSet();\r
                try{\r
                        while (rs.next()){\r
@@ -133,7 +138,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        logger.error("SQLException:" +  e);\r
                        return false;\r
                }\r
-       \r
+\r
                partitioner.startDoSave();\r
                getCommonService().save(objectsToSave);\r
                return success;\r
@@ -145,6 +150,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
         */\r
        protected abstract String getRecordQuery(IndexFungorumImportConfigurator config);\r
 \r
+\r
        /**\r
         * @return\r
         */\r
@@ -152,11 +158,12 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                String result = " SELECT id FROM " + getTableName();\r
                return result;\r
        }\r
-       \r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.cdm.io.berlinModel.in.IPartitionedIO#getPluralString()\r
         */\r
-       public String getPluralString(){\r
+       @Override\r
+    public String getPluralString(){\r
                return pluralString;\r
        }\r
 \r
@@ -167,7 +174,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                return this.dbTableName;\r
        }\r
 \r
-       \r
+\r
        protected boolean resultSetHasColumn(ResultSet rs, String columnName){\r
                try {\r
                        ResultSetMetaData metaData = rs.getMetaData();\r
@@ -182,15 +189,15 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
             return false;\r
                }\r
        }\r
-       \r
+\r
        protected boolean checkSqlServerColumnExists(Source source, String tableName, String columnName){\r
                String strQuery = "SELECT  Count(t.id) as n " +\r
                                " FROM sysobjects AS t " +\r
                                " INNER JOIN syscolumns AS c ON t.id = c.id " +\r
-                               " WHERE (t.xtype = 'U') AND " + \r
-                               " (t.name = '" + tableName + "') AND " + \r
+                               " WHERE (t.xtype = 'U') AND " +\r
+                               " (t.name = '" + tableName + "') AND " +\r
                                " (c.name = '" + columnName + "')";\r
-               ResultSet rs = source.getResultSet(strQuery) ;          \r
+               ResultSet rs = source.getResultSet(strQuery) ;\r
                int n;\r
                try {\r
                        rs.next();\r
@@ -200,9 +207,9 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        e.printStackTrace();\r
                        return false;\r
                }\r
-               \r
+\r
        }\r
-       \r
+\r
        /**\r
         * Returns a map that holds all values of a ResultSet. This is needed if a value needs to\r
         * be accessed twice\r
@@ -242,7 +249,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        idSet.add(id);\r
                }\r
        }\r
-       \r
+\r
        /**\r
         * Returns true if i is a multiple of recordsPerTransaction\r
         * @param i\r
@@ -253,11 +260,11 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                startTransaction();\r
                return (i % recordsPerLoop) == 0;\r
        }\r
-       \r
+\r
        protected void doLogPerLoop(int count, int recordsPerLog, String pluralString){\r
                if ((count % recordsPerLog ) == 0 && count!= 0 ){ logger.info(pluralString + " handled: " + (count));}\r
        }\r
-       \r
+\r
 \r
        protected void makeAuthorAndPublication(IndexFungorumImportState state, ResultSet rs, NonViralName name) throws SQLException {\r
                //authors\r
@@ -266,18 +273,18 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                if (StringUtils.isNotBlank(authorStr)){\r
                        try {\r
                                parser.parseAuthors(name, authorStr);\r
-                       } catch (StringNotParsableException e){ \r
-                               logger.warn("Authorstring not parsable: " + authorStr);\r
+                       } catch (StringNotParsableException e){\r
+                               //logger.warn("Authorstring not parsable: " + authorStr);\r
                                name.setAuthorshipCache(authorStr);\r
                        }\r
                }\r
-               \r
+\r
                //page\r
                String page = rs.getString("PAGE");\r
                if (StringUtils.isNotBlank(page)){\r
                        name.setNomenclaturalMicroReference(page);\r
                }\r
-               \r
+\r
                //Reference\r
                Reference<?> ref = ReferenceFactory.newGeneric();\r
                boolean hasInReference = false;\r
@@ -293,7 +300,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                                logger.warn("'AUTHORS' is blank for not empty PUBLISHING_AUTHORS. This is not yet handled.");\r
                        }\r
                }\r
-               \r
+\r
                //inRef + inRefAuthor\r
                if (pubAuthor != null){\r
                        Reference<?> inRef = ReferenceFactory.newGeneric();\r
@@ -301,7 +308,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        ref.setInReference(inRef);\r
                        hasInReference = true;\r
                }\r
-               \r
+\r
                //refAuthor\r
                TeamOrPersonBase<?> refAuthor = CdmBase.deproxy(name.getCombinationAuthorTeam(), TeamOrPersonBase.class);\r
                if (refAuthor == null){\r
@@ -343,7 +350,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        }\r
                }\r
                ref.setVolume(volume);\r
-               \r
+\r
                //year\r
                String yearOfPubl = rs.getString("YEAR OF PUBLICATION");\r
                String yearOnPubl = rs.getString("YEAR ON PUBLICATION");\r
@@ -357,7 +364,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                if (year != null){\r
                        ref.setDatePublished(TimePeriodParser.parseString(year));\r
                }\r
-               \r
+\r
                //preliminary, set protected titlecache as Generic Cache Generation with in references currently doesn't fully work yet\r
                String titleCache = CdmUtils.concat(", ", pubAuthorStr, title);\r
                if  ( StringUtils.isNotBlank(pubAuthorStr)){\r
@@ -367,16 +374,16 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                titleCache = CdmUtils.concat(": ", titleCache, page);\r
                titleCache = CdmUtils.concat(". ", titleCache, year);\r
                ref.setTitleCache(titleCache, true);\r
-               \r
+\r
                //set nom ref\r
                if (StringUtils.isNotBlank(titleCache)){\r
                        name.setNomenclaturalReference(ref);\r
                }\r
        }\r
-       \r
+\r
 \r
        protected MarkerType getNoLastActionMarkerType(IndexFungorumImportState state) {\r
-               return getMarkerType(state, DbLastActionMapper.uuidMarkerTypeHasNoLastAction, \r
+               return getMarkerType(state, DbLastActionMapper.uuidMarkerTypeHasNoLastAction,\r
                                "has no last action", "No last action information available", "no last action");\r
        }\r
 \r
@@ -388,7 +395,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                String strId = (id == null ? null : String.valueOf(id));\r
                IdentifiableSource source = IdentifiableSource.NewInstance(OriginalSourceType.Import, strId, namespace, sourceReference, null);\r
                taxon.addSource(source);\r
-               \r
+\r
                //no last action\r
                MarkerType hasNoLastAction = getNoLastActionMarkerType(state);\r
                taxon.addMarker(Marker.NewInstance(hasNoLastAction, true));\r
@@ -415,7 +422,7 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                MarkerType missingGUID = getMarkerType(state, PesiTransformer.uuidMarkerGuidIsMissing, "GUID is missing", "GUID is missing", null);\r
                return missingGUID;\r
        }\r
-       \r
+\r
 \r
        protected Classification getClassification(IndexFungorumImportState state) {\r
                Classification result;\r
@@ -425,12 +432,12 @@ public abstract class IndexFungorumImportBase extends CdmImportBase<IndexFungoru
                        result = makeTreeMemSave(state, sourceReference);\r
                } else {\r
                        result = getClassificationService().find(classificationUuid);\r
-               } \r
+               }\r
                return result;\r
        }\r
 \r
-       \r
 \r
 \r
-       \r
+\r
+\r
 }\r
index 1a58f1433b87a229bc95fd17ed96aaa80d0905ba..efc21393fff7ceadeb2614dda5b118b953628269 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -25,6 +25,8 @@ import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;\r
 import org.springframework.transaction.TransactionStatus;\r
 \r
+import com.microsoft.sqlserver.jdbc.SQLServerException;\r
+\r
 import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;\r
 import eu.etaxonomy.cdm.io.common.DbExportStateBase;\r
 import eu.etaxonomy.cdm.io.common.Source;\r
@@ -37,7 +39,6 @@ import eu.etaxonomy.cdm.io.common.mapping.out.DbConstantMapper;
 import eu.etaxonomy.cdm.io.common.mapping.out.DbDescriptionElementTaxonMapper;\r
 import eu.etaxonomy.cdm.io.common.mapping.out.DbDistributionStatusMapper;\r
 import eu.etaxonomy.cdm.io.common.mapping.out.DbExportIgnoreMapper;\r
-import eu.etaxonomy.cdm.io.common.mapping.out.DbExportNotYetImplementedMapper;\r
 import eu.etaxonomy.cdm.io.common.mapping.out.DbLanguageMapper;\r
 import eu.etaxonomy.cdm.io.common.mapping.out.DbObjectMapper;\r
 import eu.etaxonomy.cdm.io.common.mapping.out.DbOriginalNameMapper;\r
@@ -68,7 +69,6 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-import eu.etaxonomy.cdm.profiler.ProfilerController;\r
 /**\r
  * The export class for {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase DescriptionElements}.<p>\r
  * Inserts into DataWarehouse database table <code>Note</code>.<p>\r
@@ -82,7 +82,7 @@ import eu.etaxonomy.cdm.profiler.ProfilerController;
 @Component\r
 public class PesiDescriptionExport extends PesiExportBase {\r
        private static final Logger logger = Logger.getLogger(PesiDescriptionExport.class);\r
-       \r
+\r
        private static final Class<? extends CdmBase> standardMethodParameter = DescriptionElementBase.class;\r
 \r
        private static int modCount = 1000;\r
@@ -97,7 +97,7 @@ public class PesiDescriptionExport extends PesiExportBase {
        //decide where to handle them best (configurator, transformer, single method, ...)\r
        private static Set<Integer> excludedNoteCategories = new HashSet<Integer>(Arrays.asList(new Integer[]{250,251,252,253,10,11,13}));\r
 \r
-       \r
+\r
        //debugging\r
        private static int countDescriptions;\r
        private static int countTaxa;\r
@@ -105,11 +105,11 @@ public class PesiDescriptionExport extends PesiExportBase {
        private static int countAdditionalSources;\r
        private static int countImages;\r
        private static int countNotes;\r
-       \r
+\r
        private static int countCommonName;\r
        private static int countOccurrence;\r
        private static int countOthers;\r
-       \r
+\r
        public PesiDescriptionExport() {\r
                super();\r
        }\r
@@ -132,7 +132,7 @@ public class PesiDescriptionExport extends PesiExportBase {
 \r
                        // Stores whether this invoke was successful or not.\r
                        boolean success = true;\r
-       \r
+\r
                        // Get specific mappings: (CDM) DescriptionElement -> (PESI) Note\r
                        PesiExportMapping notesMapping = getNotesMapping();\r
                        notesMapping.initialize(state);\r
@@ -148,26 +148,27 @@ public class PesiDescriptionExport extends PesiExportBase {
                        additionalSourceMapping.initialize(state);\r
 \r
                        // Get specific mappings: (CDM) DescriptionElement -> (PESI) Additional taxon source\r
+\r
                        PesiExportMapping vernacularMapping = getVernacularNamesMapping();\r
                        vernacularMapping.initialize(state);\r
-                       \r
+\r
                        // Get specific mappings: (CDM) DescriptionElement -> (PESI) Additional taxon source\r
                        PesiExportMapping imageMapping = getImageMapping();\r
                        imageMapping.initialize(state);\r
-                       \r
+\r
                        // Start transaction\r
                        success &= doPhase01(state, notesMapping, occurrenceMapping, addSourceSourceMapping, additionalSourceMapping, vernacularMapping, imageMapping);\r
 \r
                        // Start transaction\r
                        success &= doPhase01b(state, notesMapping, occurrenceMapping, addSourceSourceMapping, additionalSourceMapping, vernacularMapping, imageMapping);\r
 \r
-                       \r
+\r
                        logger.info("PHASE 2...");\r
                        success &= doPhase02(state);\r
 \r
 \r
                        logger.info("*** Finished Making " + pluralString + " ..." + getSuccessString(success));\r
-                       \r
+\r
                        if (!success){\r
                                state.setUnsuccessfull();\r
                        }\r
@@ -180,34 +181,36 @@ public class PesiDescriptionExport extends PesiExportBase {
        }\r
 \r
        //PHASE 01: Description Elements\r
-       private boolean doPhase01(PesiExportState state, PesiExportMapping notesMapping, PesiExportMapping occurrenceMapping, PesiExportMapping addSourceSourceMapping, \r
+       private boolean doPhase01(PesiExportState state, PesiExportMapping notesMapping, PesiExportMapping occurrenceMapping, PesiExportMapping addSourceSourceMapping,\r
                        PesiExportMapping additionalSourceMapping, PesiExportMapping vernacularMapping, PesiExportMapping imageMapping) throws SQLException {\r
-               logger.info("PHASE 1...");\r
+\r
+           System.out.println("PHASE 1 of occurence import");\r
+           logger.info("PHASE 1...");\r
                int count = 0;\r
                int pastCount = 0;\r
                boolean success = true;\r
                int limit = state.getConfig().getLimitSave();\r
 \r
                List<Taxon> taxonList = null;\r
-               \r
+\r
                TransactionStatus txStatus = startTransaction(true);\r
                logger.info("Started new transaction. Fetching some " + pluralString + " (max: " + limit + ") ...");\r
                List<String> propPath = Arrays.asList(new String[]{"descriptions.elements.*"});\r
-               \r
+\r
                logger.debug("Start snapshot, before starting loop");\r
-               ProfilerController.memorySnapshot();\r
+       //      ProfilerController.memorySnapshot();\r
                //taxon descriptions\r
                int partitionCount = 0;\r
                while ((taxonList = getNextTaxonPartition(Taxon.class, limit, partitionCount++, propPath )) != null   ) {\r
 \r
                        logger.info("Fetched " + taxonList.size() + " " + pluralString + ". Exporting...");\r
-                       \r
+\r
                        for (Taxon taxon : taxonList) {\r
                                countTaxa++;\r
                                doCount(count++, modCount, pluralString);\r
                                state.setCurrentTaxon(taxon);\r
-                               success &= handleSingleTaxon(taxon, state, notesMapping, occurrenceMapping, addSourceSourceMapping, \r
-                                               additionalSourceMapping, vernacularMapping, imageMapping);      \r
+                               success &= handleSingleTaxon(taxon, state, notesMapping, occurrenceMapping, addSourceSourceMapping,\r
+                                               additionalSourceMapping, vernacularMapping, imageMapping);\r
                        }\r
                        taxonList = null;\r
                        state.setCurrentTaxon(null);\r
@@ -221,8 +224,8 @@ public class PesiDescriptionExport extends PesiExportBase {
                        txStatus = startTransaction(true);\r
                        logger.info("Started new transaction. Fetching some " + pluralString + " (max: " + limit + ") for description import ...");\r
                }\r
-               \r
-       \r
+\r
+\r
                logger.info("No " + pluralString + " left to fetch.");\r
                logger.info("Partition: " + partitionCount);\r
                logger.info("Taxa: " + countTaxa);\r
@@ -234,41 +237,41 @@ public class PesiDescriptionExport extends PesiExportBase {
                logger.info("Images: " + countImages);\r
                logger.info("Notes: " + countNotes);\r
                logger.info("Others: " + countOthers);\r
-               \r
+\r
                // Commit transaction\r
                commitTransaction(txStatus);\r
                logger.debug("Committed transaction.");\r
                return success;\r
        }\r
-       \r
+\r
        //PHASE 01b: Name Descriptions\r
-       private boolean doPhase01b(PesiExportState state, PesiExportMapping notesMapping, PesiExportMapping occurrenceMapping, PesiExportMapping addSourceSourceMapping, \r
+       private boolean doPhase01b(PesiExportState state, PesiExportMapping notesMapping, PesiExportMapping occurrenceMapping, PesiExportMapping addSourceSourceMapping,\r
                        PesiExportMapping additionalSourceMapping, PesiExportMapping vernacularMapping, PesiExportMapping imageMapping) throws SQLException {\r
                logger.info("PHASE 1b...");\r
                int count = 0;\r
                int pastCount = 0;\r
                boolean success = true;\r
                int limit = state.getConfig().getLimitSave();\r
-               \r
+\r
                List<TaxonNameDescription> nameDescList = null;\r
-               \r
+\r
                TransactionStatus txStatus = startTransaction(true);\r
                logger.info("Started new transaction. Fetching some name descriptions (max: " + limit + ") ...");\r
                List<String> propPath = Arrays.asList(new String[]{"descriptions.elements.*"});\r
-               \r
+\r
                //name descriptions\r
                int partitionCount = 0;\r
                while ((nameDescList = getNextNameDescriptionPartition( limit, partitionCount++, propPath )) != null   ) {\r
-                       \r
+\r
                        logger.info("Fetched " + nameDescList.size() + " name descriptions. Exporting...");\r
-                       \r
+\r
                        for (TaxonNameDescription desc : nameDescList) {\r
                                countTaxa++;\r
                                doCount(count++, modCount, "name descriptions");\r
                                boolean isImageGallery = desc.isImageGallery();\r
-                               \r
+\r
                                TaxonNameBase<?,?> name = desc.getTaxonName();\r
-                               \r
+\r
                                for (DescriptionElementBase element : desc.getElements()){\r
                                        if (isPurePesiName(name)){\r
                                                success &= handleDescriptionElement(state, notesMapping, occurrenceMapping, vernacularMapping, imageMapping,\r
@@ -298,7 +301,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                        txStatus = startTransaction(true);\r
                        logger.info("Started new transaction. Fetching some name descriptions (max: " + limit + ") for description import ...");\r
                }\r
-               \r
+\r
                logger.info("No " + pluralString + " left to fetch.");\r
                logger.info("Partition: " + partitionCount);\r
                logger.info("Taxa: " + countTaxa);\r
@@ -310,7 +313,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                logger.info("Images: " + countImages);\r
                logger.info("Notes: " + countNotes);\r
                logger.info("Others: " + countOthers);\r
-               \r
+\r
                // Commit transaction\r
                commitTransaction(txStatus);\r
                logger.debug("Committed transaction.");\r
@@ -318,12 +321,14 @@ public class PesiDescriptionExport extends PesiExportBase {
        }\r
 \r
        private boolean handleSingleTaxon(Taxon taxon, PesiExportState state, PesiExportMapping notesMapping, PesiExportMapping occurrenceMapping,\r
-                       PesiExportMapping addSourceSourceMapping, PesiExportMapping additionalSourceMapping, \r
+                       PesiExportMapping addSourceSourceMapping, PesiExportMapping additionalSourceMapping,\r
                        PesiExportMapping vernacularMapping, PesiExportMapping imageMapping) throws SQLException {\r
                boolean success = true;\r
+\r
+               System.out.println("handle single Taxon");\r
                Set<DescriptionBase<?>> descriptions = new HashSet<DescriptionBase<?>>();\r
                descriptions.addAll(taxon.getDescriptions());\r
-               \r
+\r
                for (DescriptionBase<?> desc : descriptions){\r
                        countDescriptions++;\r
 \r
@@ -338,7 +343,7 @@ public class PesiDescriptionExport extends PesiExportBase {
        }\r
 \r
        private boolean handleDescriptionElement(PesiExportState state, PesiExportMapping notesMapping,\r
-                       PesiExportMapping occurrenceMapping, PesiExportMapping vernacularMapping, PesiExportMapping imageMapping, \r
+                       PesiExportMapping occurrenceMapping, PesiExportMapping vernacularMapping, PesiExportMapping imageMapping,\r
                        PesiExportMapping addSourceSourceMapping, PesiExportMapping additionalSourceMapping, boolean isImageGallery, DescriptionElementBase element) throws SQLException {\r
                try {\r
                        boolean success = true;\r
@@ -357,11 +362,16 @@ public class PesiDescriptionExport extends PesiExportBase {
                                countOccurrence++;\r
                                Distribution distribution = CdmBase.deproxy(element, Distribution.class);\r
                                MarkerType markerType = getUuidMarkerType(PesiTransformer.uuidMarkerTypeHasNoLastAction, state);\r
-                               \r
+\r
                                distribution.addMarker(Marker.NewInstance(markerType, true));\r
                                if (isPesiDistribution(state, distribution)){\r
                                        countDistribution++;\r
-                                       success &=occurrenceMapping.invoke(element);\r
+                                       try{\r
+                                           success &=occurrenceMapping.invoke(element);\r
+                                       }catch(SQLServerException e){\r
+                                           System.err.println(element.getInDescription().getTitleCache());\r
+                                           e.printStackTrace();\r
+                                       }\r
                                }\r
                        }else if (isAdditionalTaxonSource(element)){\r
                                countAdditionalSources++;\r
@@ -374,7 +384,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                        }else if (isPesiNote(element)){\r
                                countNotes++;\r
                                success &= notesMapping.invoke(element);\r
-                       \r
+\r
                        }else{\r
                                countOthers++;\r
                                String featureTitle = element.getFeature() == null ? "no feature" :element.getFeature().getTitleCache();\r
@@ -399,7 +409,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                if (distribution.getStatus() == null){\r
                        return false;\r
                }\r
-               \r
+\r
                //...this may change in future so we keep the following code\r
                Integer key;\r
                //area filter\r
@@ -417,9 +427,9 @@ public class PesiDescriptionExport extends PesiExportBase {
 //                     //Macaronesia records should not be exported to PESI\r
 //                     return false;\r
 //             //TODO exclude Russion areas Rs*, and maybe ohters\r
-               \r
-               } else\r
-                       try {\r
+\r
+               } else {\r
+            try {\r
                                if (state.getTransformer().getKeyByNamedArea(area) == null){\r
                                        String warning = "Area (%s,%s) not available in PESI transformer for taxon %S: ";\r
                                        TaxonBase<?> taxon =  state.getCurrentTaxon();\r
@@ -431,9 +441,10 @@ public class PesiDescriptionExport extends PesiExportBase {
                                logger.warn("Area not available in PESI transformer " +  area.getTitleCache());\r
                                return false;\r
                        }\r
+        }\r
                return true;\r
-               \r
-//             \r
+\r
+//\r
 //             //status\r
 //             PresenceAbsenceTermBase<?> status = distribution.getStatus();\r
 //             if (status == null){\r
@@ -490,16 +501,16 @@ public class PesiDescriptionExport extends PesiExportBase {
        private boolean doPhase02(PesiExportState state) {\r
                TransactionStatus txStatus;\r
                boolean success =  true;\r
-               \r
+\r
                // Get the limit for objects to save within a single transaction.\r
                int limit = state.getConfig().getLimitSave();\r
-                                       \r
+\r
                txStatus = startTransaction(true);\r
                ExtensionType taxCommentExtensionType = (ExtensionType)getTermService().find(PesiTransformer.taxCommentUuid);\r
                ExtensionType fauCommentExtensionType = (ExtensionType)getTermService().find(PesiTransformer.fauCommentUuid);\r
                ExtensionType fauExtraCodesExtensionType = (ExtensionType)getTermService().find(PesiTransformer.fauExtraCodesUuid);\r
                List<TaxonNameBase> taxonNameList = null;\r
-               \r
+\r
                int count = 0;\r
                int pastCount = 0;\r
                Connection connection = state.getConfig().getDestination().getConnection();\r
@@ -513,25 +524,25 @@ public class PesiDescriptionExport extends PesiExportBase {
                                for (Extension extension : extensions) {\r
                                        if (extension.getType().equals(taxCommentExtensionType)) {\r
                                                String taxComment = extension.getValue();\r
-                                               invokeNotes(taxComment, \r
-                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.taxCommentUuid), \r
+                                               invokeNotes(taxComment,\r
+                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.taxCommentUuid),\r
                                                                PesiTransformer.getNoteCategoryCache(PesiTransformer.taxCommentUuid),\r
                                                                null, null, getTaxonKey(taxonName, state),connection);\r
                                        } else if (extension.getType().equals(fauCommentExtensionType)) {\r
                                                String fauComment = extension.getValue();\r
-                                               invokeNotes(fauComment, \r
-                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.fauCommentUuid), \r
+                                               invokeNotes(fauComment,\r
+                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.fauCommentUuid),\r
                                                                PesiTransformer.getNoteCategoryCache(PesiTransformer.fauCommentUuid),\r
                                                                null, null, getTaxonKey(taxonName, state),connection);\r
                                        } else if (extension.getType().equals(fauExtraCodesExtensionType)) {\r
                                                String fauExtraCodes = extension.getValue();\r
-                                               invokeNotes(fauExtraCodes, \r
-                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.fauExtraCodesUuid), \r
+                                               invokeNotes(fauExtraCodes,\r
+                                                               PesiTransformer.getNoteCategoryFk(PesiTransformer.fauExtraCodesUuid),\r
                                                                PesiTransformer.getNoteCategoryCache(PesiTransformer.fauExtraCodesUuid),\r
                                                                null, null, getTaxonKey(taxonName, state),connection);\r
                                        }\r
                                }\r
-                               \r
+\r
                                doCount(count++, modCount, pluralString);\r
                        }\r
 \r
@@ -563,48 +574,48 @@ public class PesiDescriptionExport extends PesiExportBase {
         * @param object2\r
         */\r
        private void invokeNotes(String note, Integer noteCategoryFk,\r
-                       String noteCategoryCache, Integer languageFk, String languageCache, \r
+                       String noteCategoryCache, Integer languageFk, String languageCache,\r
                        Integer taxonFk, Connection connection) {\r
-               String notesSql = "UPDATE Note SET Note_1 = ?, NoteCategoryFk = ?, NoteCategoryCache = ?, LanguageFk = ?, LanguageCache = ? WHERE TaxonFk = ?"; \r
+               String notesSql = "UPDATE Note SET Note_1 = ?, NoteCategoryFk = ?, NoteCategoryCache = ?, LanguageFk = ?, LanguageCache = ? WHERE TaxonFk = ?";\r
                try {\r
                        PreparedStatement notesStmt = connection.prepareStatement(notesSql);\r
-                       \r
+\r
                        if (note != null) {\r
                                notesStmt.setString(1, note);\r
                        } else {\r
                                notesStmt.setObject(1, null);\r
                        }\r
-                       \r
+\r
                        if (noteCategoryFk != null) {\r
                                notesStmt.setInt(2, noteCategoryFk);\r
                        } else {\r
                                notesStmt.setObject(2, null);\r
                        }\r
-                       \r
+\r
                        if (noteCategoryCache != null) {\r
                                notesStmt.setString(3, noteCategoryCache);\r
                        } else {\r
                                notesStmt.setObject(3, null);\r
                        }\r
-                       \r
+\r
                        if (languageFk != null) {\r
                                notesStmt.setInt(4, languageFk);\r
                        } else {\r
                                notesStmt.setObject(4, null);\r
                        }\r
-                       \r
+\r
                        if (languageCache != null) {\r
                                notesStmt.setString(5, languageCache);\r
                        } else {\r
                                notesStmt.setObject(5, null);\r
                        }\r
-                       \r
+\r
                        if (taxonFk != null) {\r
                                notesStmt.setInt(6, taxonFk);\r
                        } else {\r
                                notesStmt.setObject(6, null);\r
                        }\r
-                       \r
+\r
                        notesStmt.executeUpdate();\r
                } catch (SQLException e) {\r
                        logger.error("Note could not be created: " + note);\r
@@ -620,8 +631,8 @@ public class PesiDescriptionExport extends PesiExportBase {
         * @return Whether the delete operation was successful or not.\r
         */\r
        protected boolean doDelete(PesiExportState state) {\r
-               PesiExportConfigurator pesiConfig = (PesiExportConfigurator) state.getConfig();\r
-               \r
+               PesiExportConfigurator pesiConfig = state.getConfig();\r
+\r
                String sql;\r
                Source destination =  pesiConfig.getDestination();\r
 \r
@@ -679,7 +690,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                }\r
                return result;\r
        }\r
-       \r
+\r
        /**\r
         * Returns the <code>NoteCategoryCache</code> attribute.\r
         * @param descriptionElement The {@link DescriptionElementBase DescriptionElement}.\r
@@ -690,8 +701,8 @@ public class PesiDescriptionExport extends PesiExportBase {
        private static String getNoteCategoryCache(DescriptionElementBase descriptionElement, PesiExportState state) {\r
                return state.getTransformer().getCacheByFeature(descriptionElement.getFeature());\r
        }\r
-       \r
-       \r
+\r
+\r
 \r
 \r
        /**\r
@@ -711,7 +722,7 @@ public class PesiDescriptionExport extends PesiExportBase {
         * Returns the <code>LanguageCache</code> attribute.\r
         * @param descriptionElement The {@link DescriptionElementBase DescriptionElement}.\r
         * @return The <code>LanguageCache</code> attribute.\r
-        * @throws UndefinedTransformerMethodException \r
+        * @throws UndefinedTransformerMethodException\r
         * @see MethodMapper\r
         */\r
        @SuppressWarnings("unused")\r
@@ -739,7 +750,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                } else {\r
                        logger.debug("Given descriptionElement does not support languages. Hence LanguageCache could not be determined: " + descriptionElement.getUuid());\r
                }\r
-               \r
+\r
                if (multilanguageText != null) {\r
                        Set<Language> languages = multilanguageText.keySet();\r
 \r
@@ -764,7 +775,7 @@ public class PesiDescriptionExport extends PesiExportBase {
 //     private static String getRegion(DescriptionElementBase descriptionElement) {\r
 //             String result = null;\r
 //             DescriptionBase<?> inDescription = descriptionElement.getInDescription();\r
-//             \r
+//\r
 //             // Area information are associated to TaxonDescriptions and Distributions.\r
 //             if (descriptionElement.isInstanceOf(Distribution.class)) {\r
 //                     Distribution distribution = CdmBase.deproxy(descriptionElement, Distribution.class);\r
@@ -781,7 +792,7 @@ public class PesiDescriptionExport extends PesiExportBase {
 //             return result;\r
 //     }\r
 \r
-       \r
+\r
        /**\r
         * Returns the TaxonFk for a given TaxonName or Taxon.\r
         * @param state The {@link DbExportStateBase DbExportState}.\r
@@ -792,7 +803,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                TaxonBase<?> entity = state.getCurrentTaxon();\r
                return state.getDbId(entity);\r
        }\r
-       \r
+\r
        /**\r
         * Returns the TaxonFk for a given TaxonName.\r
         * @param taxonName The {@link TaxonNameBase TaxonName}.\r
@@ -802,7 +813,7 @@ public class PesiDescriptionExport extends PesiExportBase {
        private static Integer getTaxonKey(TaxonNameBase<?,?> taxonName, DbExportStateBase<?, PesiTransformer> state) {\r
                return state.getDbId(taxonName);\r
        }\r
-       \r
+\r
        /**\r
         * Returns the <code>FullName</code> attribute.\r
         * @param taxonName The {@link NonViralName NonViralName}.\r
@@ -811,7 +822,7 @@ public class PesiDescriptionExport extends PesiExportBase {
         */\r
        @SuppressWarnings("unused")\r
        private static String getTaxonFullNameCache(DescriptionElementBase deb, PesiExportState state) {\r
-               \r
+\r
                TaxonBase<?> taxon =  state.getCurrentTaxon();\r
                TaxonNameBase<?,?> taxonName = taxon.getName();\r
                NonViralName<?> nvn = CdmBase.deproxy(taxonName, NonViralName.class);\r
@@ -826,24 +837,24 @@ public class PesiDescriptionExport extends PesiExportBase {
         */\r
        private PesiExportMapping getNotesMapping() {\r
                PesiExportMapping mapping = new PesiExportMapping(dbNoteTableName);\r
-               \r
+\r
                mapping.addMapper(IdMapper.NewInstance("NoteId"));\r
                mapping.addMapper(DbTextDataMapper.NewInstance(Language.ENGLISH(), "Note_1"));\r
                //TODO\r
                mapping.addMapper(MethodMapper.NewInstance("Note_2", this, DescriptionElementBase.class));\r
                mapping.addMapper(MethodMapper.NewInstance("NoteCategoryFk", this, DescriptionElementBase.class ));\r
-               \r
+\r
                mapping.addMapper(MethodMapper.NewInstance("NoteCategoryCache", this, DescriptionElementBase.class, PesiExportState.class ));\r
                mapping.addMapper(MethodMapper.NewInstance("LanguageFk", this));\r
                mapping.addMapper(MethodMapper.NewInstance("LanguageCache", this, DescriptionElementBase.class, PesiExportState.class));\r
-               \r
+\r
 //             mapping.addMapper(MethodMapper.NewInstance("Region", this));\r
                mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("taxonFk"));\r
-               mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
+       //      mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
                mapping.addCollectionMapping(getNoteSourceMapping());\r
                return mapping;\r
        }\r
-       \r
+\r
        private CollectionExportMapping<PesiExportState, PesiExportConfigurator,PesiTransformer> getNoteSourceMapping() {\r
                String tableName = "NoteSource";\r
                String collectionAttribute = "sources";\r
@@ -855,7 +866,7 @@ public class PesiDescriptionExport extends PesiExportBase {
                mapping.addMapper(DbStringMapper.NewInstance("CitationMicroReference", "SourceDetail"));\r
                return mapping;\r
        }\r
-       \r
+\r
 \r
        /**\r
         * Returns the CDM to PESI specific export mappings for occurrences.\r
@@ -863,24 +874,24 @@ public class PesiDescriptionExport extends PesiExportBase {
         */\r
        private PesiExportMapping getOccurrenceMapping() {\r
                PesiExportMapping mapping = new PesiExportMapping(dbOccurrenceTableName);\r
-               \r
+\r
                mapping.addMapper(IdMapper.NewInstance("OccurrenceId"));\r
                mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("taxonFk"));\r
-               mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("TaxonFullNameCache", true, true, null)); \r
-               \r
+               mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("TaxonFullNameCache", true, true, null));\r
+\r
                mapping.addMapper(DbAreaMapper.NewInstance(Distribution.class, "Area", "AreaFk", ! IS_CACHE));\r
                mapping.addMapper(DbAreaMapper.NewInstance(Distribution.class, "Area", "AreaNameCache", IS_CACHE));\r
                mapping.addMapper(DbDistributionStatusMapper.NewInstance("OccurrenceStatusFk", ! IS_CACHE));\r
                mapping.addMapper(DbDistributionStatusMapper.NewInstance("OccurrenceStatusCache", IS_CACHE));\r
-               \r
+\r
 //             Use Occurrence source instead\r
                mapping.addMapper(DbExportIgnoreMapper.NewInstance("SourceFk", "Use OccurrenceSource table for sources instead"));\r
                mapping.addMapper(DbExportIgnoreMapper.NewInstance("SourceNameCache", "Use OccurrenceSource table for sources instead"));\r
-               \r
+\r
                mapping.addMapper(DbAnnotationMapper.NewInstance(null, "Notes"));\r
-               mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
+       //      mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
                mapping.addCollectionMapping(getOccurrenceSourceMapping());\r
-               \r
+\r
                return mapping;\r
        }\r
 \r
@@ -896,7 +907,7 @@ public class PesiDescriptionExport extends PesiExportBase {
 \r
                return mapping;\r
        }\r
-       \r
+\r
 \r
        /**\r
         * Returns the CDM to PESI specific export mappings for additional taxon sources to create a new\r
@@ -906,70 +917,70 @@ public class PesiDescriptionExport extends PesiExportBase {
         */\r
        private PesiExportMapping getAddTaxonSourceSourceMapping() {\r
                PesiExportMapping sourceMapping = new PesiExportMapping(PesiSourceExport.dbTableName);\r
-               \r
+\r
                sourceMapping.addMapper(IdMapper.NewInstance("SourceId"));\r
                sourceMapping.addMapper(DbConstantMapper.NewInstance("SourceCategoryFk", Types.INTEGER, PesiTransformer.REF_UNRESOLVED));\r
                sourceMapping.addMapper(DbConstantMapper.NewInstance("SourceCategoryCache", Types.VARCHAR, PesiTransformer.REF_STR_UNRESOLVED));\r
-               \r
+\r
 //             sourceMapping.addMapper(MethodMapper.NewInstance("NomRefCache", PesiSourceExport.class, "getNomRefCache", Reference.class));\r
-               \r
+\r
                sourceMapping.addMapper(DbTextDataMapper.NewInstance(Language.ENGLISH(), "NomRefCache"));\r
-               \r
+\r
                return sourceMapping;\r
        }\r
 \r
-       \r
+\r
        /**\r
         * Returns the CDM to PESI specific export mappings for additional taxon sources.\r
         * @see #{@link PesiDescriptionExport#getAddTaxonSourceSourceMapping()}\r
         * @return The {@link PesiExportMapping PesiExportMapping}.\r
         */\r
        private PesiExportMapping getAdditionalTaxonSourceMapping() {\r
-       \r
+\r
                PesiExportMapping mapping = new PesiExportMapping(dbAdditionalSourceTableName);\r
-               \r
+\r
                mapping.addMapper(MethodMapper.NewInstance("TaxonFk", this, DescriptionElementBase.class, PesiExportState.class));\r
-               \r
+\r
                mapping.addMapper(IdMapper.NewInstance("SourceFk"));\r
                mapping.addMapper(DbTextDataMapper.NewInstance(Language.ENGLISH(), "SourceNameCache"));\r
-               \r
+\r
                mapping.addMapper(DbConstantMapper.NewInstance("SourceUseFk", Types.INTEGER, PesiTransformer.NOMENCLATURAL_REFERENCE));\r
                mapping.addMapper(DbConstantMapper.NewInstance("SourceUseCache", Types.VARCHAR, PesiTransformer.STR_NOMENCLATURAL_REFERENCE));\r
-               \r
+\r
                mapping.addMapper(DbExportIgnoreMapper.NewInstance("SourceDetail", "SourceDetails not available for additional sources"));\r
-               \r
+\r
                return mapping;\r
        }\r
-       \r
+\r
        /**\r
         * Returns the CDM to PESI specific export mappings for common names.\r
         * @return The {@link PesiExportMapping PesiExportMapping}.\r
         */\r
        private PesiExportMapping getVernacularNamesMapping() {\r
                PesiExportMapping mapping = new PesiExportMapping(dbVernacularTableName);\r
-               \r
+\r
                mapping.addMapper(IdMapper.NewInstance("CommonNameId"));\r
                mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("taxonFk"));\r
-               \r
+\r
                mapping.addMapper(DbStringMapper.NewInstance("Name", "CommonName"));\r
                mapping.addMapper(DbAreaMapper.NewInstance(CommonTaxonName.class, "Area", "Region", IS_CACHE));\r
-               \r
+\r
                mapping.addMapper(DbLanguageMapper.NewInstance(CommonTaxonName.class, "Language", "LanguageFk", ! IS_CACHE));\r
                mapping.addMapper(DbLanguageMapper.NewInstance(CommonTaxonName.class, "Language", "LanguageCache", IS_CACHE));\r
-               \r
+\r
                mapping.addMapper(DbSingleSourceMapper.NewInstance("SourceFk", of ( DbSingleSourceMapper.EXCLUDE.WITH_ID) , ! IS_CACHE));\r
                mapping.addMapper(DbSingleSourceMapper.NewInstance("SourceNameCache", of ( DbSingleSourceMapper.EXCLUDE.WITH_ID) , IS_CACHE));\r
-               mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
+               //mapping.addMapper(ExpertsAndLastActionMapper.NewInstance());\r
                return mapping;\r
 \r
        }\r
-       \r
+\r
        private PesiExportMapping getImageMapping() {\r
                PesiExportMapping mapping = new PesiExportMapping(dbImageTableName);\r
                mapping.addMapper(DbDescriptionElementTaxonMapper.NewInstance("taxonFk"));\r
-               \r
+\r
                //TODO xxx\r
-               \r
+\r
                return mapping;\r
        }\r
 \r
index de39445595cf7189b081a84538017245bc3215ab..f038fd9528ef5e0d8becb028466b7d1dae087c28 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -35,17 +35,26 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, PesiTransformer>{\r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(PesiExportState.class);\r
-       \r
+\r
        private static List<Integer> processedSourceList = new ArrayList<Integer>();\r
-       \r
+\r
        private IdentifiableEntity<?> currentToObject;\r
        private IdentifiableEntity<?> currentFromObject;\r
        private TaxonBase<?> currentTaxon;\r
        private boolean sourceForAdditionalSourceCreated = false;\r
-       \r
-       private Map<UUID, MarkerType> markerTypeMap = new HashMap<UUID, MarkerType>();\r
-       public static final UUID uuidUserDefinedMarkerTypeVocabulary = UUID.fromString("5f02a261-fd7d-4fce-bbe4-21472de8cd51");\r
-       \r
+\r
+       private final Map<UUID, MarkerType> markerTypeMap = new HashMap<UUID, MarkerType>();\r
+       private final Map<String,Integer> treeIndexKingdomMap = new HashMap<String,Integer>();\r
+       /**\r
+     * @return the treeIndexKingdomMap\r
+     */\r
+    public Map<String,Integer> getTreeIndexKingdomMap() {\r
+        return treeIndexKingdomMap;\r
+    }\r
+\r
+\r
+    public static final UUID uuidUserDefinedMarkerTypeVocabulary = UUID.fromString("5f02a261-fd7d-4fce-bbe4-21472de8cd51");\r
+\r
        @Autowired\r
        //@Qualifier("termService")\r
        private ITermService termService;\r
@@ -57,7 +66,7 @@ public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, P
        public PesiExportState(PesiExportConfigurator config) {\r
                super(config);\r
        }\r
-       \r
+\r
 \r
        /**\r
         * Stores the Datawarehouse.id to a specific CDM object originally.\r
@@ -81,11 +90,11 @@ public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, P
        public Integer getDbId(CdmBase cdmBase) {\r
                return (Integer)getCurrentIO().getDbId(cdmBase, this);\r
        }\r
-       \r
+\r
        private ITermService getTermService(){\r
                return this.termService;\r
        }\r
-       \r
+\r
        /**\r
         * Returns whether the given Source object was processed before or not.\r
         * @param\r
@@ -98,7 +107,7 @@ public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, P
                        return false;\r
                }\r
        }\r
-       \r
+\r
        /**\r
         * Adds given Source to the list of processed Sources.\r
         */\r
@@ -106,7 +115,7 @@ public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, P
                if (! processedSourceList.contains(sourceId)) {\r
                        processedSourceList.add(sourceId);\r
                }\r
-               \r
+\r
                return true;\r
        }\r
 \r
@@ -148,9 +157,9 @@ public class PesiExportState extends DbExportStateBase<PesiExportConfigurator, P
        }\r
 \r
        public void putMarkerType(MarkerType markerType) {\r
-               \r
+\r
                markerTypeMap.put(markerType.getUuid(), markerType);\r
-               \r
+\r
        }\r
 \r
 \r
index bf7a4ef8223c3abd4a1b0827aa01d9935f0128a1..123e78722532eaefcb7a31e4c49e4b5c4647f2d5 100644 (file)
@@ -61,6 +61,7 @@ log4j.logger.org.hibernate=warn
 
 log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=error
 
+
 ### No warnings as thrown by SQLServer
 log4j.logger.org.hibernate.cfg = warn