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 PESI3_euroMed(){
|
26
|
// BerlinModel - Euro+Med
|
27
|
String dbms = Source.SQL_SERVER_2008;
|
28
|
String strServer = "PESIIMPORT3";
|
29
|
String strDB = "EuroPlusMed_01";
|
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
|
public static Source euroMed(){
|
46
|
// BerlinModel - Euro+Med
|
47
|
String dbms = Source.SQL_SERVER_2005;
|
48
|
String strServer = "BGBM42";
|
49
|
String strDB = "EuroPlusMed_00_Edit";
|
50
|
int port = 1247;
|
51
|
String userName = "webUser";
|
52
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
53
|
}
|
54
|
|
55
|
public static Source mcl(){
|
56
|
// BerlinModel - Euro+Med
|
57
|
String dbms = Source.SQL_SERVER_2008;
|
58
|
String strServer = "BGBM42";
|
59
|
String strDB = "MCL";
|
60
|
int port = 1433;
|
61
|
String userName = "WebUser";
|
62
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
63
|
}
|
64
|
|
65
|
public static Source Campanulaceae(){
|
66
|
// BerlinModel - Campanulaceae
|
67
|
String dbms = Source.SQL_SERVER_2005;
|
68
|
String strServer = "BGBM42";
|
69
|
String strDB = "Campanulaceae";
|
70
|
int port = 1247;
|
71
|
String userName = "webUser";
|
72
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
73
|
}
|
74
|
|
75
|
public static Source ILDIS(){
|
76
|
// BerlinModel - EditWP6
|
77
|
String dbms = Source.SQL_SERVER_2008;
|
78
|
String strServer = "BGBM42";
|
79
|
String strDB = "ILDIS_EM_BM";
|
80
|
int port = 1433;
|
81
|
String userName = "webUser";
|
82
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
83
|
}
|
84
|
|
85
|
public static Source EDIT_CICHORIEAE(){
|
86
|
// BerlinModel - EditWP6
|
87
|
String dbms = Source.SQL_SERVER_2005;
|
88
|
String strServer = "BGBM42";
|
89
|
String strDB = "EditWP6";
|
90
|
int port = 1247;
|
91
|
String userName = "webUser";
|
92
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
93
|
}
|
94
|
|
95
|
public static Source EDIT_Taraxacum(){
|
96
|
// BerlinModel - EditWP6
|
97
|
String dbms = Source.SQL_SERVER_2005;
|
98
|
String strServer = "BGBM42";
|
99
|
String strDB = "Edit_Taraxacum";
|
100
|
int port = 1247;
|
101
|
String userName = "webUser";
|
102
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
103
|
}
|
104
|
|
105
|
public static Source EDIT_Diptera(){
|
106
|
// BerlinModel - EDIT_Diptera
|
107
|
String dbms = Source.SQL_SERVER_2005;
|
108
|
String strServer = "BGBM42";
|
109
|
String strDB = "EDIT_Diptera";
|
110
|
int port = 1247;
|
111
|
String userName = "webUser";
|
112
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
113
|
}
|
114
|
|
115
|
public static Source El_Salvador(){
|
116
|
// BerlinModel - El_Salvador
|
117
|
String dbms = Source.SQL_SERVER_2005;
|
118
|
String strServer = "SQL2000Intern";
|
119
|
String strDB = "Salvador";
|
120
|
int port = 1433;
|
121
|
String userName = "WebUser";
|
122
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
123
|
}
|
124
|
|
125
|
public static Source El_Salvador_Local(){
|
126
|
// BerlinModel - El_Salvador
|
127
|
String dbms = Source.SQL_SERVER_2005;
|
128
|
String strServer = "LENOVO-T61";
|
129
|
String strDB = "Salvador";
|
130
|
int port = 1433;
|
131
|
String userName = "salvadorExport";
|
132
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
133
|
}
|
134
|
|
135
|
|
136
|
public static Source AlgaTerra(){
|
137
|
// BerlinModel - AlgaTerra
|
138
|
String dbms = Source.SQL_SERVER_2008;
|
139
|
String strServer = "BGBM17";
|
140
|
String strDB = "Algaterra";
|
141
|
int port = 1433;
|
142
|
String userName = "WebUser";
|
143
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
144
|
}
|
145
|
|
146
|
public static Source PESI_ERMS(){
|
147
|
// BerlinModel - Pesi-ERMS
|
148
|
String dbms = Source.SQL_SERVER_2005;
|
149
|
String strServer = "SQL2000Intern\\SQL2005";
|
150
|
String strDB = "BM_ERMS";
|
151
|
int port = 1433;
|
152
|
String userName = "WebUser";
|
153
|
return makeSource(dbms, strServer, strDB, port, userName, null);
|
154
|
}
|
155
|
|
156
|
/**
|
157
|
* Initializes the source.
|
158
|
* @param dbms
|
159
|
* @param strServer
|
160
|
* @param strDB
|
161
|
* @param port
|
162
|
* @param userName
|
163
|
* @param pwd
|
164
|
* @return the source
|
165
|
*/
|
166
|
private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
|
167
|
//establish connection
|
168
|
Source source = null;
|
169
|
source = new Source(dbms, strServer, strDB);
|
170
|
source.setPort(port);
|
171
|
|
172
|
pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
|
173
|
source.setUserAndPwd(userName, pwd);
|
174
|
// write pwd to account store
|
175
|
return source;
|
176
|
}
|
177
|
|
178
|
}
|