3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.cdm
.app
.berlinModelImport
;
13 import org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
16 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
19 public class BerlinModelSources
{
20 @SuppressWarnings("unused")
21 private static final Logger logger
= Logger
.getLogger(BerlinModelSources
.class);
23 public static Source
euroMed(){
24 // BerlinModel - Euro+Med
25 String dbms
= Source
.SQL_SERVER_2005
;
26 String strServer
= "BGBM42";
27 String strDB
= "EuroPlusMed_00_Edit";
29 String userName
= "webUser";
30 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
33 public static Source
Campanulaceae(){
34 // BerlinModel - Campanulaceae
35 String dbms
= Source
.SQL_SERVER_2005
;
36 String strServer
= "BGBM42";
37 String strDB
= "Campanulaceae";
39 String userName
= "webUser";
40 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
43 public static Source
ILDIS(){
44 // BerlinModel - EditWP6
45 String dbms
= Source
.SQL_SERVER_2008
;
46 String strServer
= "BGBM42";
47 String strDB
= "ILDIS_EM_BM";
49 String userName
= "webUser";
50 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
53 public static Source
EDIT_CICHORIEAE(){
54 // BerlinModel - EditWP6
55 String dbms
= Source
.SQL_SERVER_2005
;
56 String strServer
= "BGBM42";
57 String strDB
= "EditWP6";
59 String userName
= "webUser";
60 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
63 public static Source
EDIT_Taraxacum(){
64 // BerlinModel - EditWP6
65 String dbms
= Source
.SQL_SERVER_2005
;
66 String strServer
= "BGBM42";
67 String strDB
= "Edit_Taraxacum";
69 String userName
= "webUser";
70 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
73 public static Source
EDIT_Diptera(){
74 // BerlinModel - EDIT_Diptera
75 String dbms
= Source
.SQL_SERVER_2005
;
76 String strServer
= "BGBM42";
77 String strDB
= "EDIT_Diptera";
79 String userName
= "webUser";
80 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
83 public static Source
El_Salvador(){
84 // BerlinModel - El_Salvador
85 String dbms
= Source
.SQL_SERVER_2005
;
86 String strServer
= "SQL2000Intern";
87 String strDB
= "Salvador";
89 String userName
= "WebUser";
90 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
93 public static Source
El_Salvador_Local(){
94 // BerlinModel - El_Salvador
95 String dbms
= Source
.SQL_SERVER_2005
;
96 String strServer
= "LENOVO-T61";
97 String strDB
= "Salvador";
99 String userName
= "salvadorExport";
100 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
104 public static Source
AlgaTerra(){
105 // BerlinModel - AlgaTerra
106 String dbms
= Source
.SQL_SERVER_2005
;
107 String strServer
= "BGBM17";
108 String strDB
= "Algaterra";
110 String userName
= "WebUser";
111 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
114 public static Source
PESI_ERMS(){
115 // BerlinModel - Pesi-ERMS
116 String dbms
= Source
.SQL_SERVER_2005
;
117 String strServer
= "SQL2000Intern\\SQL2005";
118 String strDB
= "BM_ERMS";
120 String userName
= "WebUser";
121 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
125 * Initializes the source.
134 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
135 //establish connection
136 Source source
= null;
137 source
= new Source(dbms
, strServer
, strDB
);
138 source
.setPort(port
);
140 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
141 source
.setUserAndPwd(userName
, pwd
);
142 // write pwd to account store