Project

General

Profile

« Previous | Next » 

Revision c53a25ad

Added by Cherian Mathew about 9 years ago

updated packages for remoting source

View differences:

.gitattributes
1821 1821
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewer.java -text
1822 1822
eu.etaxonomy.taxeditor.store/src/main/java/org/eclipse/wb/swt/ResourceManager.java -text
1823 1823
eu.etaxonomy.taxeditor.store/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java -text
1824
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml -text
1825 1824
eu.etaxonomy.taxeditor.store/src/main/resources/log4j.properties -text
1826 1825
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/NameProtectTitleCacheTest.java -text
1827 1826
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/operations/AbstractTaxeditorOperationTestBase.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.java
30 30
import eu.etaxonomy.cdm.database.DataSourceNotFoundException;
31 31
import eu.etaxonomy.cdm.database.ICdmDataSource;
32 32
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
33
import eu.etaxonomy.cdm.remote.CdmPersistentRemoteSource;
34
import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
35
import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
33

  
36 34
import eu.etaxonomy.taxeditor.model.MementoHelper;
37 35
import eu.etaxonomy.taxeditor.model.MessagingUtils;
38 36
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
37
import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource;
38
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
39
import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
39 40
import eu.etaxonomy.taxeditor.store.CdmStore;
40 41
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
41 42
public class CdmDataSourceRepository{
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java
28 28
import org.eclipse.swt.widgets.Text;
29 29

  
30 30
import eu.etaxonomy.cdm.model.taxon.Classification;
31
import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
32 31
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
32
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
33 33
import eu.etaxonomy.taxeditor.store.CdmStore;
34 34

  
35 35
/**
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
25 25
import org.springframework.security.core.context.SecurityContext;
26 26
import org.springframework.security.core.context.SecurityContextHolder;
27 27

  
28

  
29
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
30
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
28 31
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
29 32
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
30 33
import eu.etaxonomy.cdm.api.service.IService;
......
36 39
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
37 40
import eu.etaxonomy.cdm.persistence.hibernate.permission.ICdmPermissionEvaluator;
38 41
import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
39
import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
40 42
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
41 43
import eu.etaxonomy.taxeditor.io.ExportManager;
42 44
import eu.etaxonomy.taxeditor.io.ImportManager;
43 45
import eu.etaxonomy.taxeditor.model.AbstractUtility;
44 46
import eu.etaxonomy.taxeditor.model.MessagingUtils;
45 47
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
48

  
49
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
50
import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySessionManager;
46 51
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
47 52
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
48 53

  
......
86 91
	private ICdmSource cdmSource;
87 92

  
88 93
	private boolean isConnected;
94
	
95

  
89 96

  
90 97
	/**
91 98
	 * <p>
......
120 127
		try {
121 128
			cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
122 129
			connect(cdmSource);
123
		} catch (CdmRemoteSourceException e) {
130
		} catch (Exception e) {
124 131
			MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
125 132
		}
126 133

  
......
247 254
	public static ConversationHolder createConversation() {
248 255
		ConversationHolder conversation = getCurrentApplicationConfiguration()
249 256
				.NewConversation();
250
		try{
257
		try {
251 258
			conversation.startTransaction();
252 259
		}catch(Exception e){
253 260
			MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
254 261
		}
255 262
		return conversation;
256 263
	}
264
	
265
	//FIXME:Remoting should be removed after moving completely to remoting
266
	private MockCdmEntitySessionManager mockCdmEntitySessionManager;
267
	
268
	private ICdmEntitySessionManager getSessionManager() {
269
		//FIXME:Remoting we should only have CdmApplicationRemoteConfiguration after move to remoting
270
		//               bad hack which should be finally removed
271
		if(getCurrentApplicationConfiguration() instanceof CdmApplicationRemoteController) {
272
			return ((CdmApplicationRemoteController)getCurrentApplicationConfiguration()).getCdmEntitySessionManager();
273
		} else {
274
			if(mockCdmEntitySessionManager == null) {
275
				mockCdmEntitySessionManager = new MockCdmEntitySessionManager();
276
			}
277
			return mockCdmEntitySessionManager;  			
278
		}
279
	}
280
	
281
	public static  ICdmEntitySessionManager getCurrentSessionManager() {
282
		if (getDefault() != null) {
283
			return getDefault().getSessionManager();
284
		}
285
		return null;
286

  
287
	}
257 288

  
258 289
	/**
259 290
	 * Generic method that will scan the getters of {@link ICdmApplicationConfiguration} for the given service
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
18 18
import org.eclipse.core.runtime.Status;
19 19
import org.eclipse.core.runtime.jobs.Job;
20 20
import org.eclipse.swt.widgets.Display;
21
import org.hibernate.collection.internal.AbstractPersistentCollection;
22
import org.hibernate.proxy.AbstractLazyInitializer;
23 21
import org.springframework.core.io.Resource;
24 22

  
25 23
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
26 24
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
27 25
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
28
import eu.etaxonomy.cdm.config.ICdmSource;
29
import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
30 26
import eu.etaxonomy.cdm.config.CdmSourceException;
31
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
27
import eu.etaxonomy.cdm.config.ICdmSource;
32 28
import eu.etaxonomy.cdm.database.DbSchemaValidation;
33 29
import eu.etaxonomy.cdm.database.ICdmDataSource;
34 30
import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
35
import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
36 31
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
37 32
import eu.etaxonomy.taxeditor.model.MessagingUtils;
33
import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
38 34
import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
39 35
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
40 36

  
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
  xmlns:context="http://www.springframework.org/schema/context"
5
  xmlns:tx="http://www.springframework.org/schema/tx"
6
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
8
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
9

  
10
  <!-- Local application context and term initializer -->
11
  <import resource="classpath:/eu/etaxonomy/cdm/localApplicationContext.xml"/>
12
  
13
  <!-- Remote application context and term initializer -->
14
  <!--  <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/> -->
15
  
16
</beans>

Also available in: Unified diff