Improved bfn related xml importer
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / app / common / CdmImportSources.java
index 51cfd7c5e997c72b8ddfcdf717c17553c8e5a8e1..1ba6cdad6390e6f133f7119905c445d769e238fe 100644 (file)
@@ -14,8 +14,8 @@ import java.net.URL;
 \r
 import org.apache.log4j.Logger;\r
 \r
+import eu.etaxonomy.cdm.app.berlinModelImport.SourceBase;\r
 import eu.etaxonomy.cdm.app.tcs.TcsSources;\r
-import eu.etaxonomy.cdm.common.AccountStore;\r
 import eu.etaxonomy.cdm.io.common.Source;\r
 \r
 /**\r
@@ -23,40 +23,26 @@ import eu.etaxonomy.cdm.io.common.Source;
  * @date 21.04.2010\r
  *\r
  */\r
-public class CdmImportSources {\r
+public class CdmImportSources extends SourceBase{\r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(CdmImportSources.class);\r
        \r
-\r
-       public static Source AFRICA_CHECKLIST_ACCESS(){\r
-               //      \r
-               String dbms = Source.ACCESS;\r
-               String strServer = null;\r
-               //String strDB = "fernsTest";\r
-               String strDB = "C:\\localCopy\\Data\\eflora\\africa\\checklist_flore_afrique_centrale_corr.mdb";\r
+       public static Source ROTE_LISTE_DB(){\r
+               String dbms = Source.ORACLE;\r
+               String strServer = "xxx";\r
+               String strDB = "dbName";\r
                int port = 1433;\r
-               String userName = "";\r
+               String userName = "adam";\r
                return  makeSource(dbms, strServer, strDB, port, userName, null);\r
        }\r
 \r
        \r
-       public static Source AFRICA_FERNS_ACCESS(){\r
-               //      \r
-               String dbms = Source.ACCESS;\r
-               String strServer = null;\r
-               //String strDB = "fernsTest";\r
-               String strDB = "C:\\localCopy\\Data\\eflora\\africa\\ferns\\Synopsis_Database_corrected.mdb";\r
-               int port = 1433;\r
-               String userName = "";\r
-               return  makeSource(dbms, strServer, strDB, port, userName, null);\r
-       }\r
-       \r
        public static Source GLOBIS(){\r
                String dbms = Source.SQL_SERVER_2005;\r
                String strServer = "LENOVO-T61";\r
                String strDB = "globis";\r
-               int port = 1433;\r
-               String userName = "adam";\r
+               int port = 0001;\r
+               String userName = "user";\r
                return  makeSource(dbms, strServer, strDB, port, userName, null);\r
        }\r
 \r
@@ -77,7 +63,44 @@ public class CdmImportSources {
                String userName = "";\r
                return  makeSource(dbms, strServer, strDB, port, userName, null);\r
        }\r
+\r
+       public static Source GLOBIS_MDB_20120928(){\r
+               String dbms = Source.ACCESS;\r
+               String strServer = null;\r
+               String strDB = "C:\\localCopy\\Data\\globis\\globis.20120928.mdb";\r
+               int port = -1;\r
+               String userName = "";\r
+               return  makeSource(dbms, strServer, strDB, port, userName, null);\r
+       }\r
+\r
+       public static Source GLOBIS_MDB_20140113(){\r
+               String dbms = Source.ACCESS;\r
+               String strServer = null;\r
+               String strDB = "C:\\localCopy\\Data\\globis\\globis_20140113.mdb";\r
+               int port = -1;\r
+               String userName = "";\r
+               return  makeSource(dbms, strServer, strDB, port, userName, null);\r
+       }\r
        \r
+       //Problem MS Access ODBC Driver does not work on PESIIMPORT 3\r
+       @Deprecated\r
+       public static Source GLOBIS_MDB_20140113_PESIIMPORT(){\r
+               String dbms = Source.ACCESS;\r
+               String strServer = null;\r
+               String strDB = "\\\\PESIIMPORT3\\globis\\globis_20140113.mdb";\r
+               int port = -1;\r
+               String userName = "";\r
+               return  makeSource(dbms, strServer, strDB, port, userName, null);\r
+       }\r
+       \r
+       public static Source GLOBIS_MDB_20140113_PESIIMPORT_SQLSERVER(){\r
+               String dbms = Source.SQL_SERVER_2008;\r
+               String strServer = "PESIIMPORT3";\r
+               String strDB = "globis_orig_20140113";\r
+               int port = 1433;\r
+               String userName = "globisImport";\r
+               return  makeSource(dbms, strServer, strDB, port, userName, null);\r
+       }\r
        \r
        public static URI SYNTHESYS_SPECIMEN(){\r
                //              tcsXmlTest.xml\r
@@ -87,25 +110,7 @@ public class CdmImportSources {
                return uri;     \r
        }\r
        \r
-       /**\r
-        * Initializes the source.\r
-        * @param dbms\r
-        * @param strServer\r
-        * @param strDB\r
-        * @param port\r
-        * @param userName\r
-        * @param pwd\r
-        * @return the source\r
-        */\r
-       private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){\r
-               //establish connection\r
-               Source source = null;\r
-               source = new Source(dbms, strServer, strDB);\r
-               source.setPort(port);\r
-                       \r
-               pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);\r
-               source.setUserAndPwd(userName, pwd);\r
-               // write pwd to account store\r
-               return source;\r
-       }\r
+       \r
+       \r
+\r
 }\r