1
|
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
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.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.app.berlinModelImport;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
|
15
|
import eu.etaxonomy.cdm.common.AccountStore;
|
16
|
import eu.etaxonomy.cdm.io.common.Source;
|
17
|
|
18
|
|
19
|
public class BerlinModelSources {
|
20
|
@SuppressWarnings("unused")
|
21
|
private static final Logger logger = Logger.getLogger(BerlinModelSources.class);
|
22
|
|
23
|
|
24
|
|
25
|
public static Source euroMed_PESI3(){
|
26
|
// BerlinModel - Euro+Med
|
27
|
String dbms = Source.SQL_SERVER_2008;
|
28
|
String strServer = "PESIIMPORT3";
|
29
|
String strDB = "EM_2014_06";
|
30
|
int port = 1433;
|
31
|
String userName = "pesiexport";
|
32
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
33
|
}
|
34
|
|
35
|
public static Source iopi(){
|
36
|
// BerlinModel - Euro+Med
|
37
|
String dbms = Source.SQL_SERVER_2008;
|
38
|
String strServer = "BGBM17";
|
39
|
String strDB = "IOPIBM";
|
40
|
int port = 1433;
|
41
|
String userName = "WebUser";
|
42
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
43
|
}
|
44
|
|
45
|
|
46
|
|
47
|
public static Source euroMed_Pub2(){
|
48
|
// BerlinModel - Euro+Med
|
49
|
String dbms = Source.SQL_SERVER_2008;
|
50
|
String strServer = "bgbm-sql03";
|
51
|
String strDB = "EuroPlusMed_Pub2";
|
52
|
int port = 1433; //was 1247
|
53
|
String userName = "WebUser"; //was webUser or pesiexport
|
54
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
55
|
}
|
56
|
|
57
|
|
58
|
public static Source euroMed_BGBM42(){
|
59
|
// BerlinModel - Euro+Med
|
60
|
String dbms = Source.SQL_SERVER_2008;
|
61
|
String strServer = "BGBM42";
|
62
|
String strDB = "EuroPlusMed_00_Edit";
|
63
|
int port = 1433; //was 1247
|
64
|
String userName = "Webuser"; //was webUser or pesiexport
|
65
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
66
|
}
|
67
|
|
68
|
public static Source mcl(){
|
69
|
// BerlinModel - Euro+Med
|
70
|
String dbms = Source.SQL_SERVER_2008;
|
71
|
String strServer = "BGBM42";
|
72
|
String strDB = "MCL";
|
73
|
int port = 1433;
|
74
|
String userName = "WebUser";
|
75
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
76
|
}
|
77
|
|
78
|
public static Source Campanulaceae(){
|
79
|
// BerlinModel - Campanulaceae
|
80
|
String dbms = Source.SQL_SERVER_2005;
|
81
|
String strServer = "BGBM42";
|
82
|
String strDB = "Campanulaceae";
|
83
|
int port = 1433;
|
84
|
String userName = "WebUser";
|
85
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
86
|
}
|
87
|
|
88
|
public static Source ILDIS(){
|
89
|
// BerlinModel - EditWP6
|
90
|
String dbms = Source.SQL_SERVER_2008;
|
91
|
String strServer = "BGBM42";
|
92
|
String strDB = "ILDIS_EM_BM";
|
93
|
int port = 1433;
|
94
|
String userName = "webUser";
|
95
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
96
|
}
|
97
|
|
98
|
public static Source EDIT_CICHORIEAE(){
|
99
|
// BerlinModel - EditWP6
|
100
|
String dbms = Source.SQL_SERVER_2005;
|
101
|
String strServer = "BGBM42";
|
102
|
String strDB = "EditWP6";
|
103
|
int port = 1433;
|
104
|
String userName = "webUser";
|
105
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
106
|
}
|
107
|
|
108
|
public static Source EDIT_Taraxacum(){
|
109
|
// BerlinModel - EditWP6
|
110
|
String dbms = Source.SQL_SERVER_2005;
|
111
|
String strServer = "BGBM42";
|
112
|
String strDB = "Edit_Taraxacum";
|
113
|
int port = 1247;
|
114
|
String userName = "webUser";
|
115
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
116
|
}
|
117
|
|
118
|
public static Source EDIT_Diptera(){
|
119
|
// BerlinModel - EDIT_Diptera
|
120
|
String dbms = Source.SQL_SERVER_2005;
|
121
|
String strServer = "BGBM42";
|
122
|
String strDB = "EDIT_Diptera";
|
123
|
int port = 1247;
|
124
|
String userName = "webUser";
|
125
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
126
|
}
|
127
|
|
128
|
public static Source El_Salvador(){
|
129
|
// BerlinModel - El_Salvador
|
130
|
String dbms = Source.SQL_SERVER_2008;
|
131
|
String strServer = "BGBM-SQL01";
|
132
|
String strDB = "Salvador";
|
133
|
int port = 1433;
|
134
|
String userName = "WebUser";
|
135
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
136
|
}
|
137
|
|
138
|
public static Source AlgaTerra(){
|
139
|
// BerlinModel - AlgaTerra
|
140
|
String dbms = Source.SQL_SERVER_2008;
|
141
|
String strServer = "BGBM-SQL01";
|
142
|
String strDB = "Algaterra";
|
143
|
int port = 1433;
|
144
|
String userName = "WebUser";
|
145
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
146
|
}
|
147
|
|
148
|
public static Source PESI_ERMS(){
|
149
|
// BerlinModel - Pesi-ERMS
|
150
|
String dbms = Source.SQL_SERVER_2005;
|
151
|
String strServer = "SQL2000Intern\\SQL2005";
|
152
|
String strDB = "BM_ERMS";
|
153
|
int port = 1433;
|
154
|
String userName = "WebUser";
|
155
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
156
|
}
|
157
|
|
158
|
public static Source MT_MOOSE(){
|
159
|
String dbms = Source.SQL_SERVER_2005;
|
160
|
String strServer = "BGBM-SQL02";
|
161
|
String strDB = "MTMoose";
|
162
|
int port = 1433;
|
163
|
String userName = "WebUser";
|
164
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
165
|
}
|
166
|
|
167
|
public static Source MT_Standardliste(){
|
168
|
String dbms = Source.SQL_SERVER_2005;
|
169
|
String strServer = "BGBM-SQL02";
|
170
|
String strDB = "MTStandardliste";
|
171
|
int port = 1433;
|
172
|
String userName = "WebUser";
|
173
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
174
|
}
|
175
|
|
176
|
/**
|
177
|
* Initializes the source.
|
178
|
* @param dbms
|
179
|
* @param strServer
|
180
|
* @param strDB
|
181
|
* @param port
|
182
|
* @param userName
|
183
|
* @param pwd
|
184
|
* @return the source
|
185
|
*/
|
186
|
private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
|
187
|
//establish connection
|
188
|
Source source = null;
|
189
|
source = new Source(dbms, strServer, strDB);
|
190
|
source.setPort(port);
|
191
|
|
192
|
pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
|
193
|
source.setUserAndPwd(userName, pwd);
|
194
|
// write pwd to account store
|
195
|
return source;
|
196
|
}
|
197
|
|
198
|
}
|