2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.app
.pesi
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.app
.common
.ImportUtils
;
15 import eu
.etaxonomy
.cdm
.config
.AccountStore
;
16 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
19 * @author a.babadshanjan
22 public class PesiSources
{
23 @SuppressWarnings("unused")
24 private static final Logger logger
= Logger
.getLogger(PesiSources
.class);
26 public static Source
faunEu_pesi3(){
27 // Fauna Europaea auf pesiimport3
28 String dbms
= Source
.SQL_SERVER_2008
;
29 String strServer
= "pesiimport3";
30 String strDB
= "FaunEu";
32 String userName
= "pesiExportFaunaEu";
33 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
36 public static Source
mfn_faunEu_pesi3(){
37 // Fauna Europaea auf pesiimport3
38 String dbms
= Source
.SQL_SERVER_2008
;
39 String strServer
= "pesiimport3";
40 String strDB
= "MfN_FaunaEuropaea";
42 String userName
= "pesiExportFaunaEu";
43 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
46 public static Source
faunEu(){
48 String dbms
= Source
.SQL_SERVER_2008
;
49 String strServer
= "BGBM42"; // "192.168.1.36";
50 String strDB
= "FaunEu";
52 String userName
= "WebUser";
53 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
56 public static Source
faunaEu_previous(){
58 String dbms
= Source
.SQL_SERVER_2008
;
59 String strServer
= "BGBM42"; // "192.168.1.36";
60 String strDB
= "FaunEu_2_2";
62 String userName
= "WebUser";
63 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
65 public static Source
faunaEu_old(){
67 String dbms
= Source
.SQL_SERVER_2008
;
68 String strServer
= "BGBM42"; // "192.168.1.36";
69 String strDB
= "FaunaEu_1_3";
71 String userName
= "WebUser";
72 return ImportUtils
.makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
75 public static Source
PESI_ERMS(){
76 // BerlinModel - Pesi-ERMS
77 String dbms
= Source
.SQL_SERVER_2008
;
78 String strServer
= "BGBM42";
79 String strDB
= "ERMS";
81 String userName
= "WebUser";
82 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
86 public static Source
PESI3_ERMS(){
87 // BerlinModel - Pesi-ERMS
88 String dbms
= Source
.SQL_SERVER_2008
;
89 String strServer
= "Pesiimport3";
90 String strDB
= "ERMS";
92 String userName
= "pesiexport";
93 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
96 public static Source
PESI2019_ERMS(){
97 // BerlinModel - Pesi-ERMS
98 String dbms
= Source
.SQL_SERVER_2008
;
99 String strServer
= "BGBM-PESISQL\\SQLEXPRESS";
100 String strDB
= "erms";
102 String userName
= "pesiimport";
103 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
106 public static Source
PESI3_IF(){
107 // BerlinModel - Pesi-ERMS
108 String dbms
= Source
.SQL_SERVER_2008
;
109 String strServer
= "Pesiimport3";
110 String strDB
= "IF_2014_06";
112 String userName
= "pesiExportFaunaEu";
113 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
116 public static Source
PESI_IF(){
117 // BerlinModel - Pesi-IF
118 String dbms
= Source
.SQL_SERVER_2008
;
119 String strServer
= "BGBM42";
122 String userName
= "WebUser";
123 return makeSource(dbms
, strServer
, strDB
, port
, userName
, null);
127 * Initializes the source.
136 private static Source
makeSource(String dbms
, String strServer
, String strDB
, int port
, String userName
, String pwd
){
137 //establish connection
138 Source source
= null;
139 source
= new Source(dbms
, strServer
, strDB
);
140 source
.setPort(port
);
142 pwd
= AccountStore
.readOrStorePassword(dbms
, strServer
, userName
, pwd
);
143 source
.setUserAndPwd(userName
, pwd
);
144 // write pwd to account store