Project

General

Profile

« Previous | Next » 

Revision b2cf37e3

Added by Niels Hoffmann over 12 years ago

View differences:

eu.etaxonomy.taxeditor.cdmlib/.classpath
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<classpath>
3
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.9-SNAPSHOT.jar"/>
4
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.9-SNAPSHOT.jar"/>
5
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.9-SNAPSHOT.jar"/>
6
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.9-SNAPSHOT.jar" sourcepath="/Users/n.hoffmann/.m2/repository/eu/etaxonomy/cdmlib-model/3.0.9-SNAPSHOT/cdmlib-model-3.0.9-SNAPSHOT-sources.jar"/>
7
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.9-SNAPSHOT.jar" sourcepath="/Users/n.hoffmann/.m2/repository/eu/etaxonomy/cdmlib-persistence/3.0.9-SNAPSHOT/cdmlib-persistence-3.0.9-SNAPSHOT-sources.jar"/>
8
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.9-SNAPSHOT.jar"/>
9
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.9-SNAPSHOT.jar"/>
10
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.9-SNAPSHOT.jar"/>
11 3
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
12 4
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
13 5
	<classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>
......
24 16
	<classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>
25 17
	<classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>
26 18
	<classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>
19
	<classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
27 20
	<classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>
28 21
	<classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>
29 22
	<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
......
114 107
	<classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
115 108
	<classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>
116 109
	<classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>
110
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.9-SNAPSHOT.jar"/>
111
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.9-SNAPSHOT.jar"/>
112
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.9-SNAPSHOT.jar"/>
113
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.9-SNAPSHOT.jar" sourcepath="/Users/nph/.m2/repository/eu/etaxonomy/cdmlib-model/3.0.9-SNAPSHOT/cdmlib-model-3.0.9-SNAPSHOT-sources.jar"/>
114
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.9-SNAPSHOT.jar" sourcepath="/Users/n.hoffmann/.m2/repository/eu/etaxonomy/cdmlib-persistence/3.0.9-SNAPSHOT/cdmlib-persistence-3.0.9-SNAPSHOT-sources.jar"/>
115
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.9-SNAPSHOT.jar"/>
116
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.9-SNAPSHOT.jar"/>
117
	<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.9-SNAPSHOT.jar" sourcepath="/cdmlib-services"/>
117 118
	<classpathentry kind="output" path="target/classes"/>
118 119
</classpath>
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
88 88
   eu.etaxonomy.cdm.model.common",
89 89
 eu.etaxonomy.cdm.common;uses:="org.jdom.output,org.jdom",
90 90
 eu.etaxonomy.cdm.common.media,
91
 eu.etaxonomy.cdm.common.monitor,
91 92
 eu.etaxonomy.cdm.database;
92 93
  uses:="org.springframework.transaction,
93 94
   org.apache.log4j,
......
798 799
 lib/hibernate-annotations-3.4.0-SNAPSHOT.jar,
799 800
 lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar,
800 801
 lib/hibernate-core-3.4.0-SNAPSHOT.jar,
801
 lib/hibernate-envers-3.4.0-SNAPSHOT.jar,
802 802
 lib/hibernate-search-3.1.0.GA.jar,
803 803
 lib/hibernate-tools-3.2.0.ga.jar,
804 804
 lib/hibernate-validator-4.0.0.CR1.jar,
......
882 882
 lib/cdmlib-persistence-3.0.9-SNAPSHOT.jar,
883 883
 lib/cdmlib-print-3.0.9-SNAPSHOT.jar,
884 884
 lib/cdmlib-remote-3.0.9-SNAPSHOT.jar,
885
 lib/cdmlib-services-3.0.9-SNAPSHOT.jar
885
 lib/cdmlib-services-3.0.9-SNAPSHOT.jar,
886
 lib/hibernate-envers-3.4.0-SNAPSHOT.jar
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java
15 15
 * @created Sep 17, 2010
16 16
 * @version 1.0
17 17
 */
18
public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.IProgressMonitor {
18
public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monitor.IProgressMonitor {
19 19
	
20 20
	private IProgressMonitor progressMonitor;
21 21

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
115 115
	public static final String BULK_EDITOR_OCCURRENCE_SHOW_FIELD_OBSERVATIONS = "eu.etaxonomy.taxeditor.bulkeditor.occurrence.showFieldObservations";
116 116

  
117 117
	public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
118

  
119
	public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
118 120
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
11 11
package eu.etaxonomy.taxeditor.store;
12 12

  
13 13
import java.sql.SQLException;
14
import java.util.concurrent.CancellationException;
14 15

  
15 16
import org.eclipse.core.runtime.IProgressMonitor;
16 17
import org.eclipse.core.runtime.IStatus;
......
93 94
						applicationContextBean, dataSource, dbSchemaValidation,
94 95
						false, subprogressMonitor);
95 96
			} catch (Exception e) {
97
				if(! causeIsCancelationExceptionRecursive(e)){
98
					return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + dataSource.getName(), e);
99
				}
100
			} finally {
96 101
				monitor.done();
97
				return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + dataSource.getName(), e);
98 102
			}
99 103
		}
100 104
		
101
		monitor.done();
105
		
102 106

  
103 107
		if (!monitor.isCanceled()) {
104 108
			CdmStore.setInstance(applicationController, dataSource);
......
213 217
		}
214 218
	}
215 219

  
220
	private boolean causeIsCancelationExceptionRecursive(Throwable throwable){
221
		if(throwable == null){
222
			return false;
223
		}else if(throwable instanceof CancellationException){
224
			return true;
225
		}else{
226
			return causeIsCancelationExceptionRecursive(throwable.getCause());
227
		}
228
	}
229
	
216 230
	private void checkDatabaseReachable(IProgressMonitor monitor) {
217 231
		try {
218 232
			monitor.subTask("Checking if datasource is reachable.");
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
22 22
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
23 23
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
24 24
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
25
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
26
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
25 27
import eu.etaxonomy.taxeditor.store.CdmStore;
26 28
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
27 29
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
......
55 57
	/** {@inheritDoc} */
56 58
	@Override
57 59
	public void addElement(TypeDesignationBase element) {
58
		getEntity().addTypeDesignation(element, false);
60
		getEntity().addTypeDesignation(element, PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ADD_TYPES_TO_ALL_NAMES));
59 61
	}
60 62

  
61 63
	/** {@inheritDoc} */
......
89 91
	/** {@inheritDoc} */
90 92
	@Override
91 93
	public void removeElement(TypeDesignationBase element) {
92
		CdmStore.getService(INameService.class).deleteTypeDesignation(getEntity(), element);
93
		
94
//		getEntity().removeTypeDesignation(element);
94
		boolean removeTypeDesignationFromAllTypifiedNames = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ADD_TYPES_TO_ALL_NAMES);
95
		TaxonNameBase entity = removeTypeDesignationFromAllTypifiedNames ? null : getEntity();
96
		CdmStore.getService(INameService.class).deleteTypeDesignation(entity, element);
95 97
	}
96 98

  
97 99
	/*

Also available in: Unified diff