1
|
/**
|
2
|
* Copyright (C) 2020 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.webapp.datasource.common;
|
10
|
|
11
|
import eu.etaxonomy.cdm.config.ICdmSource;
|
12
|
import eu.etaxonomy.taxeditor.model.MessagingUtils;
|
13
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
14
|
import eu.etaxonomy.taxeditor.webapp.CdmServer;
|
15
|
|
16
|
/**
|
17
|
* @author k.luther
|
18
|
* @since Aug 26, 2020
|
19
|
*/
|
20
|
public class LocalCdmStore {
|
21
|
private static CdmServer managedServer;
|
22
|
|
23
|
public static void setManagedServer(CdmServer server) {
|
24
|
managedServer = server;
|
25
|
}
|
26
|
|
27
|
public static CdmServer getManagedServer() {
|
28
|
return managedServer;
|
29
|
}
|
30
|
|
31
|
/**
|
32
|
* Initialize the with the last edited datasource
|
33
|
* @deprecated this method is not needed anymore after fully changing to remoting.
|
34
|
* Therefore it will be removed
|
35
|
*/
|
36
|
@Deprecated
|
37
|
public static void connect() {
|
38
|
try {
|
39
|
ICdmSource cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
|
40
|
CdmStore.connect(cdmSource);
|
41
|
} catch (Exception e) {
|
42
|
MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
|
43
|
}
|
44
|
}
|
45
|
}
|