3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.app
.common
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.app
.tcs
.TcsSources
;
18 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
19 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
26 public class CdmImportSources
{
27 @SuppressWarnings("unused")
28 private static final Logger logger
= Logger
.getLogger(CdmImportSources
.class);
31 public static Source
AFRICA_CHECKLIST_ACCESS(){
33 String dbms
= Source
.ACCESS
;
34 String strServer
= null;
35 //String strDB = "fernsTest";
36 String strDB
= "C:\\localCopy\\Data\\eflora\\africa\\checklist_flore_afrique_centrale_corr.mdb";
39 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
43 public static Source
AFRICA_FERNS_ACCESS(){
45 String dbms
= Source
.ACCESS
;
46 String strServer
= null;
47 //String strDB = "fernsTest";
48 String strDB
= "C:\\localCopy\\Data\\eflora\\africa\\ferns\\Synopsis_Database_corrected.mdb";
51 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
54 public static Source
GLOBIS(){
55 // BerlinModel - Pesi-ERMS
56 String dbms
= Source
.SQL_SERVER_2005
;
57 String strServer
= "LENOVO-T61";
58 String strDB
= "globis";
60 String userName
= "adam";
61 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
64 public static Source
GLOBIS_ODBC(){
65 // BerlinModel - Pesi-ERMS
66 String dbms
= Source
.ODDBC
;
67 String strServer
= "LENOVO-T61";
68 String strDB
= "globis";
70 String userName
= "sa";
71 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
75 public static URI
SYNTHESYS_SPECIMEN(){
77 URL url
= new TcsSources().getClass().getResource("/specimen/SynthesysSpecimenExample.xls");
78 String sourceUrl
= url
.toString();
79 URI uri
= URI
.create(sourceUrl
);
84 * Initializes the source.
93 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
94 //establish connection
96 source
= new Source(dbms
, strServer
, strDB
);
99 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
100 source
.setUserAndPwd(userName
, pwd
);
101 // write pwd to account store