From: jenkins Date: Tue, 31 May 2016 14:50:45 +0000 (+0200) Subject: Merge branch 'release/4.1.0' X-Git-Tag: 4.1.0 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/6edbda865885ff579c6ecf02aa27277b96569a6c?hp=4b30e08bd7dda419269eb80d4eba302f25e32621 Merge branch 'release/4.1.0' --- diff --git a/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF index 75d152be6..d4fe77bdd 100644 --- a/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Application Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin Bundle-Vendor: EDIT Bundle-Localization: OSGI-INF/l10n/plugin diff --git a/eu.etaxonomy.taxeditor.application/pom.xml b/eu.etaxonomy.taxeditor.application/pom.xml index 5eade585c..5cbac05ff 100644 --- a/eu.etaxonomy.taxeditor.application/pom.xml +++ b/eu.etaxonomy.taxeditor.application/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF index f0a153cc0..a09e6c7bf 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Bulkeditor Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor, diff --git a/eu.etaxonomy.taxeditor.bulkeditor/pom.xml b/eu.etaxonomy.taxeditor.bulkeditor/pom.xml index 72e55400b..8de09f723 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/pom.xml +++ b/eu.etaxonomy.taxeditor.bulkeditor/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java index 4ee1e3318..f8210b335 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java @@ -10,6 +10,7 @@ package eu.etaxonomy.taxeditor.bulkeditor.command; +import java.util.Collections; import java.util.Map; import org.apache.log4j.Logger; @@ -32,8 +33,6 @@ import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; /** - *

DynamicNewObjectMenu class.

- * * @author n.hoffmann * @created 17.04.2009 * @version 1.0 @@ -44,9 +43,7 @@ public class DynamicNewObjectMenu extends CompoundContributionItem { private final IHandlerService handlerService = (IHandlerService) BulkEditorUtil.getService(IHandlerService.class); private Map classLabelPairs; - /* (non-Javadoc) - * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems() - */ + /** {@inheritDoc} */ @Override protected IContributionItem[] getContributionItems() { @@ -99,10 +96,12 @@ public class DynamicNewObjectMenu extends CompoundContributionItem { if(input instanceof AbstractBulkEditorInput){ IEntityCreator entityCreator = ((AbstractBulkEditorInput) input).getEntityCreator(); - return entityCreator.getKeyLabelPairs(); + if(entityCreator!=null){ + return entityCreator.getKeyLabelPairs(); + } } } - return null; + return Collections.EMPTY_MAP; } } diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java index 8b6ad8db4..f783a0965 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java @@ -74,7 +74,6 @@ public class OpenBulkEditorContributionItem extends CompoundContributionItem { String groupName = "test"; contributionItems.add(new Separator(groupName)); contributionItems.add(BulkEditorInputType.NAME.createContributionItem()); - contributionItems.add(BulkEditorInputType.NAME_RELATIONSHIP.createContributionItem()); contributionItems.add(BulkEditorInputType.TAXON.createContributionItem()); contributionItems.add(new Separator(groupName)); contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem()); diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java index cb7da8a2f..f42174ba7 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java @@ -16,6 +16,7 @@ import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -132,7 +133,7 @@ public class DeleteHandler extends AbstractHandler { DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the name?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); int result_dialog= dialog.open(); - if (result_dialog == 1){ + if (result_dialog != Status.OK){ return null; } result = service.delete(((TaxonNameBase) object).getUuid(), config); @@ -148,7 +149,7 @@ public class DeleteHandler extends AbstractHandler { if (((Taxon)object).getTaxonNodes().isEmpty()){ dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the taxon?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); int result_dialog= dialog.open(); - if (result_dialog == 1){ + if (result_dialog != Status.OK){ return null; } result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null); @@ -162,7 +163,7 @@ public class DeleteHandler extends AbstractHandler { SynonymDeletionConfigurator config = new SynonymDeletionConfigurator(); DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the synonym?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); int result_dialog= dialog.open(); - if (result_dialog == 1){ + if (result_dialog != Status.OK){ return null; } result = service.deleteSynonym(((Synonym)object).getUuid(), config); diff --git a/eu.etaxonomy.taxeditor.cdmlib/.classpath b/eu.etaxonomy.taxeditor.cdmlib/.classpath index 2d19a8920..c197e2e6c 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/.classpath +++ b/eu.etaxonomy.taxeditor.cdmlib/.classpath @@ -1,251 +1,251 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF index 68379b5a7..00eed9920 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CDM Library Dependencies Plugin Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Eclipse-BundleShape: dir Export-Package: com.google.api, com.google.api.detect, @@ -497,15 +497,15 @@ Bundle-ClassPath: ., lib/batik-util-1.7.jar, lib/batik-xml-1.7.jar, lib/c3p0-0.9.5.2.jar, - lib/cdmlib-commons-4.0.0.jar, - lib/cdmlib-ext-4.0.0.jar, - lib/cdmlib-io-4.0.0.jar, - lib/cdmlib-model-4.0.0.jar, - lib/cdmlib-persistence-4.0.0.jar, - lib/cdmlib-print-4.0.0.jar, - lib/cdmlib-remote-4.0.0.jar, - lib/cdmlib-services-4.0.0.jar, - lib/cdmlib-test-4.0.0.jar, + lib/cdmlib-commons-4.1.0.jar, + lib/cdmlib-ext-4.1.0.jar, + lib/cdmlib-io-4.1.0.jar, + lib/cdmlib-model-4.1.0.jar, + lib/cdmlib-persistence-4.1.0.jar, + lib/cdmlib-print-4.1.0.jar, + lib/cdmlib-remote-4.1.0.jar, + lib/cdmlib-services-4.1.0.jar, + lib/cdmlib-test-4.1.0.jar, lib/cglib-3.2.0.jar, lib/cglib-nodep-3.2.0.jar, lib/classmate-1.3.1.jar, diff --git a/eu.etaxonomy.taxeditor.cdmlib/build.properties b/eu.etaxonomy.taxeditor.cdmlib/build.properties index cf341edc1..598af2d1e 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/build.properties +++ b/eu.etaxonomy.taxeditor.cdmlib/build.properties @@ -25,15 +25,15 @@ bin.includes = META-INF/,\ lib/batik-util-1.7.jar,\ lib/batik-xml-1.7.jar,\ lib/c3p0-0.9.5.2.jar,\ - lib/cdmlib-commons-4.0.0.jar,\ - lib/cdmlib-ext-4.0.0.jar,\ - lib/cdmlib-io-4.0.0.jar,\ - lib/cdmlib-model-4.0.0.jar,\ - lib/cdmlib-persistence-4.0.0.jar,\ - lib/cdmlib-print-4.0.0.jar,\ - lib/cdmlib-remote-4.0.0.jar,\ - lib/cdmlib-services-4.0.0.jar,\ - lib/cdmlib-test-4.0.0.jar,\ + lib/cdmlib-commons-4.1.0.jar,\ + lib/cdmlib-ext-4.1.0.jar,\ + lib/cdmlib-io-4.1.0.jar,\ + lib/cdmlib-model-4.1.0.jar,\ + lib/cdmlib-persistence-4.1.0.jar,\ + lib/cdmlib-print-4.1.0.jar,\ + lib/cdmlib-remote-4.1.0.jar,\ + lib/cdmlib-services-4.1.0.jar,\ + lib/cdmlib-test-4.1.0.jar,\ lib/cglib-3.2.0.jar,\ lib/cglib-nodep-3.2.0.jar,\ lib/classmate-1.3.1.jar,\ diff --git a/eu.etaxonomy.taxeditor.cdmlib/pom.xml b/eu.etaxonomy.taxeditor.cdmlib/pom.xml index 45de6d34c..07761b950 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/pom.xml +++ b/eu.etaxonomy.taxeditor.cdmlib/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 eu.etaxonomy.taxeditor.cdmlib diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java index 997526936..0ba73ba4e 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacher.java @@ -18,8 +18,8 @@ import net.sf.ehcache.Element; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import org.hibernate.SessionFactory; +import org.hibernate.boot.Metadata; import org.hibernate.boot.MetadataSources; -import org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl; import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; @@ -29,8 +29,6 @@ import org.hibernate.metadata.ClassMetadata; import org.hibernate.property.access.spi.Getter; import org.osgi.framework.Bundle; -import org.hibernate.boot.Metadata; - public class CdmModelCacher { @@ -79,14 +77,18 @@ public class CdmModelCacher { SessionFactory sessionFactory = null; Map modelClassMap = new HashMap(); try { - sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory(); - Configuration configuration = buildConfiguration(HB_CONFIG_FILE_PATH); +// ConnectionProvider connectionProvider = registry.getService(ConnectionProvider.class); +// DatasourceConnectionProviderImpl providerImpl = registry.getService(DatasourceConnectionProviderImpl.class); + + Metadata metadata = new MetadataSources( registry ).buildMetadata(); + sessionFactory = metadata.buildSessionFactory(); +// Configuration configuration = buildConfiguration(HB_CONFIG_FILE_PATH); Map classMetaDataMap = sessionFactory.getAllClassMetadata(); - Metadata metadata = new MetadataSources( registry ).getMetadataBuilder().applyImplicitNamingStrategy( ImplicitNamingStrategyJpaCompliantImpl.INSTANCE ).build(); +// Metadata metadata = new MetadataSources( registry ).getMetadataBuilder().applyImplicitNamingStrategy( ImplicitNamingStrategyJpaCompliantImpl.INSTANCE ).build(); for(ClassMetadata classMetaData :classMetaDataMap.values()) { - Class mappedClass = classMetaData.getMappedClass(); + Class mappedClass = classMetaData.getMappedClass(); String mappedClassName = mappedClass.getName(); @@ -101,6 +103,7 @@ public class CdmModelCacher { // The registry would be destroyed by the SessionFactory, but we had trouble building the SessionFactory // so destroy it manually. StandardServiceRegistryBuilder.destroy( registry ); + e.printStackTrace(); } diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacherConnectionProvider.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacherConnectionProvider.java new file mode 100644 index 000000000..6297b5b6c --- /dev/null +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmModelCacherConnectionProvider.java @@ -0,0 +1,34 @@ +package eu.etaxonomy.taxeditor.remoting.cache; + +import javax.sql.DataSource; + +import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl; + +import eu.etaxonomy.cdm.database.CdmDataSource; +import eu.etaxonomy.cdm.model.name.NomenclaturalCode; + +/** + * This is a very preliminary class to get the model cache running. Need to better understand how + * the datasource works with hibernate service registry before implementing the correct way. + * Or use a running source. + * @author a.mueller + * + */ +public class CdmModelCacherConnectionProvider extends DatasourceConnectionProviderImpl{ + + public CdmModelCacherConnectionProvider() { + super(); + setDataSource(getDataSourcePreliminary()); + } + + private DataSource getDataSourcePreliminary() { + String database = "xyz"; + String path = "C:\\Users\\a.mueller\\.cdmLibrary\\writableResources\\h2\\LocalH2_" + database; + String username = "sa"; + CdmDataSource dataSource = CdmDataSource.NewH2EmbeddedInstance("cdmTest", username, "", path, NomenclaturalCode.ICNAFP); + return dataSource; + } + + + +} diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java index ceca3e97e..03bb2520b 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java @@ -48,7 +48,8 @@ public class ProxyUtils { public static enum CollectionType { SET, LIST, - MAP; + MAP, + BAG; @Override public String toString() { @@ -56,9 +57,13 @@ public class ProxyUtils { } } - public static Object getCollectionType(Object obj) { + public static Object getCollectionType(Object obj, Class clazz) { if(obj != null) { if(obj instanceof List) { + //the field in PersistentBag is called "bag" although it is an ArrayList -> # + if(clazz.equals(PersistentBag.class)){ + return CollectionType.BAG; + } return CollectionType.LIST; } if(obj instanceof Set) { @@ -75,19 +80,19 @@ public class ProxyUtils { public static Object getObject(PersistentCollection pc) { if(pc != null) { if(pc instanceof PersistentSet) { - return new HashSet((Set)pc); + return new HashSet<>((Set)pc); } if(pc instanceof PersistentSortedSet) { - return new TreeSet((Set)pc); + return new TreeSet<>((Set)pc); } if(pc instanceof PersistentList || pc instanceof PersistentBag) { - return new ArrayList((List)pc); + return new ArrayList<>((List)pc); } if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) { - return new HashMap((Map)pc); + return new HashMap<>((Map)pc); } if(pc instanceof PersistentSortedMap) { - return new TreeMap((Map)pc); + return new TreeMap<>((Map)pc); } throw new CdmRemotingException("Cannot get Collection field for type " + pc.getClass().getName()); } @@ -97,19 +102,19 @@ public class ProxyUtils { public static CollectionField getCollectionField(PersistentCollection pc) { if(pc != null) { if(pc instanceof PersistentSet) { - return new CollectionField(new HashSet((Set)pc), CollectionType.SET); + return new CollectionField(new HashSet<>((Set)pc), CollectionType.SET); } if(pc instanceof PersistentSortedSet) { - return new CollectionField(new TreeSet((Set)pc), CollectionType.SET); + return new CollectionField(new TreeSet<>((Set)pc), CollectionType.SET); } if(pc instanceof PersistentList) { - return new CollectionField(new ArrayList((List)pc), CollectionType.LIST); + return new CollectionField(new ArrayList<>((List)pc), CollectionType.LIST); } if(pc instanceof PersistentMap || pc instanceof PersistentMultiLanguageText) { - return new CollectionField(new HashMap((Map)pc), CollectionType.MAP); + return new CollectionField(new HashMap<>((Map)pc), CollectionType.MAP); } if(pc instanceof PersistentSortedMap) { - return new CollectionField(new TreeMap((Map)pc), CollectionType.MAP); + return new CollectionField(new TreeMap<>((Map)pc), CollectionType.MAP); } throw new CdmRemotingException("Cannot get Collection field for type " + pc.getClass().getName()); } @@ -171,7 +176,8 @@ public class ProxyUtils { return false; } - public static Object remoteLoadPersistentCollectionIfProxy(Object o, UUID ownerUuid, String fieldName) throws ClassNotFoundException { + @SuppressWarnings("unchecked") + public static Object remoteLoadPersistentCollectionIfProxy(Object o, UUID ownerUuid, String fieldName) throws ClassNotFoundException { if(o != null && o instanceof HibernateProxy) { LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer(); if(hli.isUninitialized()) { diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java index 28e6446b2..2a5f81522 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java @@ -62,18 +62,9 @@ public class CdmServerInfo { private final static String NAME_PRODUCTION = "cybertaxonomy.org"; private final static String SERVER_PRODUCTION = "api.cybertaxonomy.org"; - private final static String NAME_INTEGRATION = "edit-integration"; - private final static String SERVER_INTEGRATION = "int.e-taxonomy.eu"; - private final static String NAME_DEMO_1 = "edit-WS I"; private final static String SERVER_DEMO_1 = "160.45.63.230"; - private final static String NAME_DEMO_2 = "edit-WS II"; - private final static String SERVER_DEMO_2 = "160.45.63.231"; - - private final static String NAME_TEST = "edit-test"; - private final static String SERVER_TEST = "test.e-taxonomy.eu"; - public final static String SERVER_LOCALHOST = "localhost"; private final static String NAME_LOCALHOST = "localhost"; public final static String NAME_LOCALHOST_MGD = "localhost mgd."; @@ -81,7 +72,6 @@ public class CdmServerInfo { private final static String NAME_LOCALHOST_DEV = "localhost-dev"; private final static String NAME_INSTANCE_LOCALHOST_DEV = "local-dev"; private final static String SERVER_LOCALHOST_DEV = "localhost"; - private final static int PORT_LOCALHOST_DEV = 8080; private final static String BASEPATH_LOCALHOST_DEV = ""; public final static int NULL_PORT = -1; @@ -380,7 +370,7 @@ public class CdmServerInfo { return serverLastModified.compareTo(editorLastModified); } - return 0; + return result; } @@ -441,11 +431,8 @@ public class CdmServerInfo { private static List createDefaultServerConfigList() { List serverInfoList = new ArrayList(); - // serverInfoList.add(new CdmServerInfoConfig(NAME_PRODUCTION, SERVER_PRODUCTION, 80, "")); - //serverInfoList.add(new CdmServerInfoConfig(NAME_INTEGRATION, SERVER_INTEGRATION, 80, CDMSERVER_PREFIX)); + serverInfoList.add(new CdmServerInfoConfig(NAME_PRODUCTION, SERVER_PRODUCTION, 80, "", false)); serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_1, SERVER_DEMO_1, 80, CDMSERVER_PREFIX, false)); - // serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_2, SERVER_DEMO_2, 80, CDMSERVER_PREFIX)); - serverInfoList.add(new CdmServerInfoConfig(NAME_TEST, SERVER_TEST, 80, CDMSERVER_PREFIX, false)); serverInfoList.add(new CdmServerInfoConfig(NAME_LOCALHOST, SERVER_LOCALHOST, 8080, CDMSERVER_PREFIX, true)); return serverInfoList; } diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java index e37e53034..1b2fc8abc 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java @@ -1347,7 +1347,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers if (clazz != null) { //CollectionField cf = cachedCommonService.getCollectionField(col); //cachedCommonService.updatePersistentCollection(cf); - Object collectionType = ProxyUtils.getCollectionType(obj); + Object collectionType = ProxyUtils.getCollectionType(obj, clazz); Field field = clazz.getDeclaredField(collectionType.toString()); field.setAccessible(true); field.set(this, obj); diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml index e48ff8a30..491b20315 100644 --- a/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml +++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml @@ -7,11 +7,17 @@ after_transaction + + org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl + - org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl - + eu.etaxonomy.taxeditor.remoting.cache.CdmModelCacherConnectionProvider + + - - - + \ No newline at end of file diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF index 8ff069550..b7dfc5537 100644 --- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Editor Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin Bundle-Vendor: %Bundle-Vendor.0 Bundle-Localization: OSGI-INF/l10n/plugin diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml index 993ee94f1..a9032e066 100644 --- a/eu.etaxonomy.taxeditor.editor/plugin.xml +++ b/eu.etaxonomy.taxeditor.editor/plugin.xml @@ -808,14 +808,18 @@ name="eu.etaxonomy.taxeditor.editor.separator4" visible="true"> - - + + + + eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java index 97bfe0e5a..3f893ddf3 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java @@ -33,6 +33,7 @@ import eu.etaxonomy.cdm.model.common.ITreeNode; import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; import eu.etaxonomy.cdm.model.occurrence.FieldUnit; import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.Synonym; import eu.etaxonomy.cdm.model.taxon.TaxonBase; import eu.etaxonomy.cdm.model.taxon.TaxonNode; import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor; @@ -173,8 +174,19 @@ public class EditorUtil extends AbstractUtility { throws PartInitException { TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid); if (taxonBase != null && taxonBase.isOrphaned()) { - MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported."); + if(taxonBase.isInstanceOf(Synonym.class)){ + MessagingUtils.warningDialog("Orphaned accepted taxon", TaxonEditorInput.class, "The accepted " + + "taxon of this synonym is not part of any classification. Editing with the " + + "name editor is currently not implemented. Try to edit the taxon with the bulk editor."); return; + } + else{ + MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon " + + "i.e. a taxon that is not connected to a classification and not having any taxonomic " + + "relationships. Editing of orphaned taxa in the name editor is currently not supported. " + + "Try editing with the bulk editor"); + return; + } } TaxonEditorInput input = TaxonEditorInput .NewInstanceFromTaxonBase(taxonBaseUuid); diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java index fc6951c5c..d127c3f31 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java @@ -171,9 +171,11 @@ public class TaxonEditorInput extends CdmEntitySessionInput implements IEditorI if(taxonNode != null){ init(taxonNode); } - }else if(taxonNodes.size() == 0){ + } else if (taxonNodes.size() == 0) { // this is an undesired state - MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened."); + MessagingUtils.warningDialog("Incorrect state",TaxonEditorInput.class,"The accepted " + + "taxon is not part of any classification. Editing with the " + + "name editor is currently not implemented. Try to edit the taxon with the bulk editor."); } } diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java index 0c03146a4..caee71329 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java @@ -31,13 +31,12 @@ import eu.etaxonomy.taxeditor.store.CdmStore; * * @author p.ciardelli * @created 16.01.2009 - * @version 1.0 */ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation { private final Taxon misapplication; - private Reference citation; + private Reference citation; private String microcitation; @@ -93,9 +92,6 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation { return postExecute(null); } - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ /** {@inheritDoc} */ @Override public IStatus redo(IProgressMonitor monitor, IAdaptable info) @@ -103,9 +99,6 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation { return execute(monitor, info); } - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ /** {@inheritDoc} */ @Override public IStatus undo(IProgressMonitor monitor, IAdaptable info) diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java index bab0e949c..898301e69 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java @@ -11,12 +11,12 @@ package eu.etaxonomy.taxeditor.editor.view.concept; import org.eclipse.jface.action.GroupMarker; -import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ListViewer; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Menu; @@ -44,9 +44,6 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC private ListViewer viewer; - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ @Override protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) { if(AbstractUtility.getActiveEditor() == null){ @@ -74,25 +71,16 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#onComplete() - */ @Override public boolean onComplete() { return true; } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getViewer() - */ @Override public Viewer getViewer() { return viewer; } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite) - */ @Override public void createViewer(Composite parent) { viewer = new ListViewer(parent); @@ -101,13 +89,11 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC viewer.setLabelProvider(new ConceptLabelProvider()); - viewer.setSorter(new ConceptViewerSorter()); + viewer.setSorter(new ViewerSorter()); getSite().setSelectionProvider(viewer); createMenu(); - - createToolbar(); } private void createMenu(){ @@ -122,16 +108,6 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC control.setMenu(menu); } - private void createToolbar() { - IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager(); -// toolBarManager.add(); -// toolBarManager.add(); - } - - - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.editor.view.AbstractCdmEditorViewPart#changed(java.lang.Object) - */ @Override public void changed(Object object) { getViewer().refresh(); diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewerSorter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewerSorter.java deleted file mode 100644 index 640430125..000000000 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewerSorter.java +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ -/** -* Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy -* http://www.e-taxonomy.eu -* -* The contents of this file are subject to the Mozilla Public License Version 1.1 -* See LICENSE.TXT at the top of this package for the full license terms. -*/ - -package eu.etaxonomy.taxeditor.editor.view.concept; - -import org.eclipse.jface.viewers.ViewerSorter; - -/** - * @author n.hoffmann - * @created Jan 24, 2011 - * @version 1.0 - */ -public class ConceptViewerSorter extends ViewerSorter { - -} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java index 5c7dfd2bf..bd0723b7e 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientAgentService.java @@ -841,4 +841,12 @@ public class TransientAgentService implements IAgentService { public List load(List arg0, List arg1) { return defaultService.load(arg0, arg1); } + + /** + * {@inheritDoc} + */ + @Override + public List> getUuidAndAbbrevTitleCache() { + return defaultService.getUuidAndAbbrevTitleCache(); + } } diff --git a/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml b/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml index 3beebb010..67afdf08f 100644 --- a/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml +++ b/eu.etaxonomy.taxeditor.feature.jre.linux64/feature.xml @@ -2,7 +2,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 eu.etaxonomy.taxeditor.feature.jre.linux64 diff --git a/eu.etaxonomy.taxeditor.feature.platform/feature.xml b/eu.etaxonomy.taxeditor.feature.platform/feature.xml index c109e2bd6..f882bd56c 100644 --- a/eu.etaxonomy.taxeditor.feature.platform/feature.xml +++ b/eu.etaxonomy.taxeditor.feature.platform/feature.xml @@ -2,7 +2,7 @@ diff --git a/eu.etaxonomy.taxeditor.feature.platform/pom.xml b/eu.etaxonomy.taxeditor.feature.platform/pom.xml index 8b5a27be3..719b31ccb 100644 --- a/eu.etaxonomy.taxeditor.feature.platform/pom.xml +++ b/eu.etaxonomy.taxeditor.feature.platform/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 eu.etaxonomy.taxeditor.feature.platform diff --git a/eu.etaxonomy.taxeditor.feature/feature.xml b/eu.etaxonomy.taxeditor.feature/feature.xml index 45fd01333..cb1e14171 100644 --- a/eu.etaxonomy.taxeditor.feature/feature.xml +++ b/eu.etaxonomy.taxeditor.feature/feature.xml @@ -2,7 +2,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 eu.etaxonomy.taxeditor.feature diff --git a/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF index 1f58e6b66..893f51735 100644 --- a/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Help Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator Bundle-Vendor: EDIT Require-Bundle: org.eclipse.ui, diff --git a/eu.etaxonomy.taxeditor.help/pom.xml b/eu.etaxonomy.taxeditor.help/pom.xml index 77161074c..705b0a2c3 100644 --- a/eu.etaxonomy.taxeditor.help/pom.xml +++ b/eu.etaxonomy.taxeditor.help/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.molecular.lib/.classpath b/eu.etaxonomy.taxeditor.molecular.lib/.classpath index 93500de9a..55f260ddb 100644 --- a/eu.etaxonomy.taxeditor.molecular.lib/.classpath +++ b/eu.etaxonomy.taxeditor.molecular.lib/.classpath @@ -1,17 +1,17 @@ - - - - - - + + + + - - - + + + - - + + + + diff --git a/eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF index 1762973e4..e81d3d0d6 100644 --- a/eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF @@ -2,19 +2,19 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: eu.etaxonomy.taxeditor.molecular.lib Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular.lib;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-ClassPath: ., - lib/bioinfweb-commons-bio-2-SNAPSHOT.jar, - lib/bioinfweb-commons-core-2-SNAPSHOT.jar, - lib/bioinfweb-commons-swing-2-SNAPSHOT.jar, - lib/bioinfweb-commons-swt-2-SNAPSHOT.jar, + lib/bioinfweb-commons-bio-2.0.0-preview-1.jar, + lib/bioinfweb-commons-core-2.0.0-preview-1.jar, + lib/bioinfweb-commons-swing-2.0.0-preview-1.jar, + lib/bioinfweb-commons-swt-2.0.0-preview-1.jar, lib/core-1.9.2-SNAPSHOT.jar, - lib/libralign-biojava1-0-SNAPSHOT.jar, - lib/libralign-core-0-SNAPSHOT.jar, - lib/libralign-swt-0-SNAPSHOT.jar, + lib/libralign-biojava1-0.4.0-preview-1.jar, + lib/libralign-core-0.4.0-preview-1.jar, + lib/libralign-swt-0.4.0-preview-1.jar, lib/sequencing-1.9.2-SNAPSHOT.jar, - lib/tic-core-2-SNAPSHOT.jar, - lib/tic-swt-2-SNAPSHOT.jar + lib/tic-core-2.0.0-preview-1.jar, + lib/tic-swt-2.0.0-preview-1.jar Export-Package: info.bioinfweb.commons, info.bioinfweb.commons.appversion, info.bioinfweb.commons.beans, diff --git a/eu.etaxonomy.taxeditor.molecular.lib/build.properties b/eu.etaxonomy.taxeditor.molecular.lib/build.properties index 97e80af18..6e6ff3a5a 100644 --- a/eu.etaxonomy.taxeditor.molecular.lib/build.properties +++ b/eu.etaxonomy.taxeditor.molecular.lib/build.properties @@ -1,12 +1,12 @@ bin.includes = META-INF/,\ - lib/bioinfweb-commons-bio-2-SNAPSHOT.jar,\ - lib/bioinfweb-commons-core-2-SNAPSHOT.jar,\ - lib/bioinfweb-commons-swing-2-SNAPSHOT.jar,\ - lib/bioinfweb-commons-swt-2-SNAPSHOT.jar,\ + lib/bioinfweb-commons-bio-2.0.0-preview-1.jar,\ + lib/bioinfweb-commons-core-2.0.0-preview-1.jar,\ + lib/bioinfweb-commons-swing-2.0.0-preview-1.jar,\ + lib/bioinfweb-commons-swt-2.0.0-preview-1.jar,\ lib/core-1.9.2-SNAPSHOT.jar,\ - lib/libralign-biojava1-0-SNAPSHOT.jar,\ - lib/libralign-core-0-SNAPSHOT.jar,\ - lib/libralign-swt-0-SNAPSHOT.jar,\ + lib/libralign-biojava1-0.4.0-preview-1.jar,\ + lib/libralign-core-0.4.0-preview-1.jar,\ + lib/libralign-swt-0.4.0-preview-1.jar,\ lib/sequencing-1.9.2-SNAPSHOT.jar,\ - lib/tic-core-2-SNAPSHOT.jar,\ - lib/tic-swt-2-SNAPSHOT.jar + lib/tic-core-2.0.0-preview-1.jar,\ + lib/tic-swt-2.0.0-preview-1.jar diff --git a/eu.etaxonomy.taxeditor.molecular.lib/pom.xml b/eu.etaxonomy.taxeditor.molecular.lib/pom.xml index f504ca4d7..c16a3cd44 100644 --- a/eu.etaxonomy.taxeditor.molecular.lib/pom.xml +++ b/eu.etaxonomy.taxeditor.molecular.lib/pom.xml @@ -7,7 +7,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 @@ -115,49 +115,49 @@ info.bioinfweb.libralign libralign-core - 0-SNAPSHOT + 0.4.0-preview-1 info.bioinfweb.libralign libralign-swt - 0-SNAPSHOT + 0.4.0-preview-1 info.bioinfweb.libralign libralign-biojava1 - 0-SNAPSHOT + 0.4.0-preview-1 info.bioinfweb.commons.java bioinfweb-commons-swt - 2-SNAPSHOT + 2.0.0-preview-1 info.bioinfweb.commons.java bioinfweb-commons-core - 2-SNAPSHOT + 2.0.0-preview-1 info.bioinfweb.commons.java bioinfweb-commons-bio - 2-SNAPSHOT + 2.0.0-preview-1 info.bioinfweb.commons.java bioinfweb-commons-swing - 2-SNAPSHOT + 2.0.0-preview-1 info.bioinfweb.tic tic-core - 2-SNAPSHOT + 2.0.0-preview-1 info.bioinfweb.tic tic-swt - 2-SNAPSHOT + 2.0.0-preview-1 diff --git a/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF index 593d5d854..18f97e0df 100644 --- a/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Molecular Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/eu.etaxonomy.taxeditor.molecular/pom.xml b/eu.etaxonomy.taxeditor.molecular/pom.xml index 4178c7577..bec68636b 100644 --- a/eu.etaxonomy.taxeditor.molecular/pom.xml +++ b/eu.etaxonomy.taxeditor.molecular/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF index e6469213f..1bdef5bc2 100644 --- a/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Navigation Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.cdm, eu.etaxonomy.taxeditor.navigation, diff --git a/eu.etaxonomy.taxeditor.navigation/pom.xml b/eu.etaxonomy.taxeditor.navigation/pom.xml index ff3b99cb6..8b2665ce8 100644 --- a/eu.etaxonomy.taxeditor.navigation/pom.xml +++ b/eu.etaxonomy.taxeditor.navigation/pom.xml @@ -3,7 +3,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java index 07e8caca4..b9107f06b 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java @@ -46,7 +46,7 @@ public class DeleteHandler extends AbstractHandler { return null; } - boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?"); + boolean confirmation = MessagingUtils.confirmDialog("Confirm deletion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?"); if(confirmation){ diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java index 691cccb16..f4eb7d182 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/RemotingDeletePolytomousKeyHandler.java @@ -17,8 +17,13 @@ import org.eclipse.core.commands.operations.AbstractOperation; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; import org.eclipse.ui.handlers.HandlerUtil; +import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewLabels; import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RemotingDeletePolytomousKeyOperation; @@ -58,6 +63,7 @@ public class RemotingDeletePolytomousKeyHandler extends RemotingCdmHandler { if(!confirmation) { return Status.CANCEL_STATUS; } + closeObsoleteEditor(event); return Status.OK_STATUS; } @@ -79,5 +85,27 @@ public class RemotingDeletePolytomousKeyHandler extends RemotingCdmHandler { // TODO Auto-generated method stub } + protected boolean closeObsoleteEditor(ExecutionEvent event){ + boolean result = true; + IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage(); + + for (IEditorReference ref : activePage.getEditorReferences()) { + try { + IEditorInput input = ref.getEditorInput(); + if (input instanceof PolytomousKeyEditorInput) { + UUID uuidForKey = ((PolytomousKeyEditorInput) input).getKey().getUuid(); + for (UUID keyUuid :keysToDelete) { + if( uuidForKey.equals(keyUuid)){ + result &= activePage.closeEditor(ref.getEditor(false), false); + } + } + + } + } catch (PartInitException e) { + continue; + } + } + return result; + } } diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java index ea945e104..78007ae5d 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java @@ -58,7 +58,6 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySession; import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled; import eu.etaxonomy.taxeditor.store.CdmStore; import eu.etaxonomy.taxeditor.store.LoginManager; -import eu.etaxonomy.taxeditor.view.CdmViewerChooser; /** * Taxonomic tree implementation using Common Navigator Framework. @@ -181,7 +180,7 @@ public class TaxonNavigator extends CommonNavigator implements /** * Refresh this navigators viewer */ - public void refresh(Set objects) { + public void refresh(Set objects) { for(Object obj : objects) { getCommonViewer().refresh(obj); } diff --git a/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF index 17a61f89f..5f1ef980c 100644 --- a/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Printpublisher Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Require-Bundle: org.eclipse.osgi, org.eclipse.ui, eu.etaxonomy.taxeditor.cdmlib, diff --git a/eu.etaxonomy.taxeditor.printpublisher/pom.xml b/eu.etaxonomy.taxeditor.printpublisher/pom.xml index caebd4276..60fab66a1 100644 --- a/eu.etaxonomy.taxeditor.printpublisher/pom.xml +++ b/eu.etaxonomy.taxeditor.printpublisher/pom.xml @@ -3,7 +3,7 @@ taxeditor-parent eu.etaxonomy - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF index 89d29d066..1ec9bb92f 100644 --- a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: DataStore Bundle Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin Bundle-Vendor: EDIT Export-Package: eu.etaxonomy.cdm, diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties index a583b3c6e..29fb7936d 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties @@ -43,11 +43,10 @@ command.label.2 = Datasource command.label.3 = Error Log command.label.4 = Reporting command.label.5 = Switch User -command.label.6 = Connect +command.label.6 = Create Data Model command.label.7 = New command.label.8 = Edit command.label.9 = Delete -command.label.10 = Close Active Connection command.label.11 = Update Datamodel menu.label.0 = New command.label.12 = Vocabulary @@ -57,7 +56,6 @@ extension.name = Popup Menu Commands command.name = Connect Datasource command.name.0 = Edit Datasource command.name.1 = Create Datasource -command.name.2 = Close Active Connection command.name.3 = Update Datasource command.name.4 = Show Login Window command.name.5 = Open Defined Term Editor diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties index 2b82b3b32..f4b5a5283 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties @@ -43,12 +43,11 @@ command.label.2 = Datenquelle command.label.3 = Fehlermeldungen command.label.4 = Berichte command.label.5 = Benutzer wechseln -command.label.6 = Verbinden +command.label.6 = Datenmodell erstellen command.label.7 = Neu command.label.8 = Bearbeiten command.label.9 = L\u00f6schen -command.label.10 = Schlie\u00dfe aktive Verbindung -command.label.11 = Aktualisiere Datenmodel +command.label.11 = Aktualisiere Datenmodell menu.label.0 = Neu command.label.12 = Vokabular command.label.13 = Definierter Begriff @@ -57,7 +56,6 @@ extension.name = Popup Men\u00fc Befehle command.name = Verbinde Datenquelle command.name.0 = Bearbeite Datenquelle command.name.1 = Erstelle Datenquelle -command.name.2 = Schlie\u00dfe aktive Verbindungen command.name.3 = Aktualisiere Datenquellen command.name.4 = Zeige Login Window command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties index ad2787688..9675726a1 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties @@ -1,39 +1,55 @@ -CdmDataSourceViewPart_1=Loading datasources -CdmDataSourceViewPart_10=Server -CdmDataSourceViewPart_11=Name -CdmDataSourceViewPart_12=Connected -CdmDataSourceViewPart_2=Notes -CdmDataSourceViewPart_3=Compatible -CdmDataSourceViewPart_4=CDM Version -CdmDataSourceViewPart_5=Created -CdmDataSourceViewPart_6=Nomenclatural Code -CdmDataSourceViewPart_7=Database -CdmDataSourceViewPart_8=Type -CdmDataSourceViewPart_9=Up -LanguageEditorPreferencePage_ChooseDefaultLanguage=Please choose your default language for the editor: -LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restarted, in order to complete the language switch.\nDo you want to restart now? -LanguageEditorPreferencePage_PleaseRestart=Please Restart -LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect. -OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required. -OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator. -UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! -UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid. -UriWithLabelElement_INVALID_URL=Invalid URI -UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser - -ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting -ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection -ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already. -ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available -ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n -ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource. - -LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database. -LoginDialog_LOGIN=Login -LoginDialog_PASSWORD=Password -LoginDialog_REALLY_CANCEL=Do you really want to cancel? -LoginDialog_USER_LOGIN=User Login -LoginDialog_USER_NAME=Username - -CdmViewerContextMenu_OPEN=Open (%s) -CdmViewerContextMenu_OPEN_IN=Open in... +CdmDataSourceViewPart_1=Loading datasources +CdmDataSourceViewPart_10=Server +CdmDataSourceViewPart_11=Name +CdmDataSourceViewPart_12=Connected +CdmDataSourceViewPart_2=Notes +CdmDataSourceViewPart_3=Compatible +CdmDataSourceViewPart_4=CDM Version +CdmDataSourceViewPart_5=Created +CdmDataSourceViewPart_6=Nomenclatural Code +CdmDataSourceViewPart_7=Database +CdmDataSourceViewPart_8=Type +CdmDataSourceViewPart_9=Up +LanguageEditorPreferencePage_ChooseDefaultLanguage=Please choose your default language for the editor: +LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restarted, in order to complete the language switch.\nDo you want to restart now? +LanguageEditorPreferencePage_PleaseRestart=Please Restart +LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect. +OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required. +OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator. +UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! +UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid. +UriWithLabelElement_INVALID_URL=Invalid URI +UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser + +ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available +ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently creating a data model for a datasource already. +ChangeConnectionHandler_ALREADY_CONNECTING=Already creating data model +ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource. +ChangeConnectionHandler_CREATE_DATAMODEL=Create Data Model +ChangeConnectionHandler_REALLY_CREATE_DATAMODEL=Do you want to create the data model for %s?\n\nCAUTION: Existing data will be deleted!\n\nNote: Creating the data model may take some time. + +LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database. +LoginDialog_LOGIN=Login +LoginDialog_PASSWORD=Password +LoginDialog_REALLY_CANCEL=Do you really want to cancel? +LoginDialog_USER_LOGIN=User Login +LoginDialog_USER_NAME=Username + +CdmViewerContextMenu_OPEN=Open (%s) +CdmViewerContextMenu_OPEN_IN=Open in... + +CdmStoreConnector_AUTHENTICATING_USER=Authenticating user +CdmStoreConnector_CHECK_IF_EDITOR_IS_COMPATIBLE=Checking if datasource is compatible with this editor. +CdmStoreConnector_CHECK_IF_NON_EMPTY=Checking if datasource is a non empty CDM database. +CdmStoreConnector_CHECK_IF_REACHABLE=Checking if datasource is reachable. +CdmStoreConnector_COMPATIBILITY_CHECK_FAILED=Datasource Compatibility Check failed +CdmStoreConnector_COULD_NOT_CONNECT_TO_CHOSEN_DATASOURCE=Could not connect to chosen datasource +CdmStoreConnector_COULD_NOT_CREATE_DATAMODEL=Could not create data model +CdmStoreConnector_CREATING_DATAMODEL=Creating data model for %s +CdmStoreConnector_ERROR_DURING_DATAMODEL_CREATION=An error occurred while trying to create data model for data source: %s\nPlease clear the data base and retry. +CdmStoreConnector_SUCCESS=Success +CdmStoreConnector_DATA_MODEL_CREATION_SUCCESSFUL=Data model created successfully +CdmStoreConnector_REASON=Reason: +CdmStoreConnector_SCHEME_NOT_COMPATIBLE=The database schema for the chosen datasource '%s' \n is not compatible for this version of the taxonomic editor. \n\n%s +CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE=Please update the chosen datasource or choose a new data source to connect to in the Datasource View. +CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE=Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible datasource diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties index 7cab6fc63..8f3745f4f 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties @@ -14,18 +14,19 @@ LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte w LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten? LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich. -OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich. +OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des Taxonnavigators erforderlich. +OrderPreferencePage_PleaseReopenNavigator=Bitte schließen sie den Taxonnavigator und öffnen ihn erneut. UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\! UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht geöffnet werden. URI ist ung\u00FCtlig. UriWithLabelElement_INVALID_URL=Ung\u00FCltige URI UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen -ChangeConnectionHandler_ALREADY_CONNECTING=Verbindung wird aufgebaut -ChangeConnectionHandler_CONFIRM_DATASOURCE=Verbindung bestätigen -ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=Es wird schon eine Verbindung zu einer Datenquelle aufgebaut +ChangeConnectionHandler_ALREADY_CONNECTING=Datenmodell wird erstellt +ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=Es wird schon das Datenmodell für eine Datenquelle erstellt ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Gewählte Datenquelle nicht verfügbar -ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Wollen Sie sich wirklich mit dieser Datenquelle verbinden?\n\n ChangeConnectionHandler_NOT_AVAILABLE_REASONS=Eventuell ist der Server nicht verfügbar oder erreichbar.\n\nStellen Sie bitte auch sicher, dass sie Netzzugang haben, wenn sie sich zu einer Remote-Datenquelle verbinden. +ChangeConnectionHandler_CREATE_DATAMODEL=Datenmodell erstellen +ChangeConnectionHandler_REALLY_CREATE_DATAMODEL=Wollen sie wirklich das Datenmodell für %s erstellen?\n\nACHTUNG: Existierende Daten werden gelöscht!\n\nHinweis: Die Erstellung kann einige Zeit dauern. LoginDialog_CANCEL_MESSAGE=Ein Abbruch wird die Verbindung zur Datenquelle schließen. LoginDialog_LOGIN=Login @@ -37,3 +38,18 @@ LoginDialog_USER_NAME=Benutzername CdmViewerContextMenu_OPEN=\u00d6ffnen (%s) CdmViewerContextMenu_OPEN_IN=\u00d6ffnen in... +CdmStoreConnector_AUTHENTICATING_USER=Benutzer authentifizieren +CdmStoreConnector_CHECK_IF_EDITOR_IS_COMPATIBLE=Überprüfe, ob der Datenquelle mit diesem Editor kompatibel ist +CdmStoreConnector_CHECK_IF_NON_EMPTY=Überprüfe, of die Datenquelle nicht leer ist +CdmStoreConnector_CHECK_IF_REACHABLE=Überprüfe, ob die Datenquelle erreichbar ist +CdmStoreConnector_COMPATIBILITY_CHECK_FAILED=Datenquellenkompatibilitätscheck fehlgeschlagen +CdmStoreConnector_COULD_NOT_CONNECT_TO_CHOSEN_DATASOURCE=Verbindung zur ausgewählten Datenquelle fehlgeschlagen +CdmStoreConnector_COULD_NOT_CREATE_DATAMODEL=Could not create data model +CdmStoreConnector_CREATING_DATAMODEL=Erstelle Datenmodell für %s +CdmStoreConnector_ERROR_DURING_DATAMODEL_CREATION=Ein Fehler ist aufgetreten bei der Erstellung des Datenmodells für: %s\nBitte leeren Sie die Datenbank und versuchen es erneut. +CdmStoreConnector_SUCCESS=Erfolgreich +CdmStoreConnector_DATA_MODEL_CREATION_SUCCESSFUL=Datenmodell wurde efolgreich erstellt +CdmStoreConnector_REASON=Grund: +CdmStoreConnector_SCHEME_NOT_COMPATIBLE=Das Datenbankschema für die gewählte Datenquelle '%s' \n ist nicht kompatibel mit dieser Version des Editors. \n\n%s +CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE=Bitte aktualisieren Sie die ausgewählte Datenquelle oder wählen Sie eine neue Datenquelle aus. +CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE=Bitte aktualisieren Sie den Taxonomic Editor (Hilfe->Suche nach Updates) oder wählen sie eine kompatible Datenquelle diff --git a/eu.etaxonomy.taxeditor.store/plugin.xml b/eu.etaxonomy.taxeditor.store/plugin.xml index 768db4a3e..3ecd5c12a 100644 --- a/eu.etaxonomy.taxeditor.store/plugin.xml +++ b/eu.etaxonomy.taxeditor.store/plugin.xml @@ -452,14 +452,11 @@ label="%command.label.6" style="push"> - - - - - - + + + + - - - - - - - - - - - - + + + + + + eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java index 9d094c53a..e71b2d0a2 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java @@ -47,6 +47,8 @@ public class Messages extends NLS { public static String ChangeConnectionHandler_ALREADY_CONNECTING; public static String ChangeConnectionHandler_CONFIRM_DATASOURCE; public static String ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY; + public static String ChangeConnectionHandler_CREATE_DATAMODEL; + public static String ChangeConnectionHandler_REALLY_CREATE_DATAMODEL; public static String ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE; public static String ChangeConnectionHandler_REALLY_WANT_TO_CONNECT; public static String ChangeConnectionHandler_NOT_AVAILABLE_REASONS; @@ -54,6 +56,21 @@ public class Messages extends NLS { public static String UriWithLabelElement_INVALID_URL; public static String UriWithLabelElement_OPEN_EXTERNAL_BROWSER; public static String UriWithLabelElement_URL_NOT_SAVED; + public static String CdmStoreConnector_AUTHENTICATING_USER; + public static String CdmStoreConnector_CHECK_IF_EDITOR_IS_COMPATIBLE; + public static String CdmStoreConnector_CHECK_IF_NON_EMPTY; + public static String CdmStoreConnector_CHECK_IF_REACHABLE; + public static String CdmStoreConnector_COMPATIBILITY_CHECK_FAILED; + public static String CdmStoreConnector_COULD_NOT_CONNECT_TO_CHOSEN_DATASOURCE; + public static String CdmStoreConnector_SUCCESS; + public static String CdmStoreConnector_DATA_MODEL_CREATION_SUCCESSFUL; + public static String CdmStoreConnector_COULD_NOT_CREATE_DATAMODEL; + public static String CdmStoreConnector_CREATING_DATAMODEL; + public static String CdmStoreConnector_ERROR_DURING_DATAMODEL_CREATION; + public static String CdmStoreConnector_REASON; + public static String CdmStoreConnector_SCHEME_NOT_COMPATIBLE; + public static String CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE; + public static String CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java index e700d2e35..fdaa3e0c4 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java @@ -50,6 +50,7 @@ import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.IHandlerService; @@ -216,13 +217,22 @@ public abstract class AbstractUtility { * @return a {@link org.eclipse.ui.IViewPart} object. */ public static IViewPart getView(String id, boolean restore) { - IViewReference[] references = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage().getViewReferences(); - for (IViewReference reference : references) { - if (reference.getId().equals(id)) { - return reference.getView(restore); - } - } + IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + IViewReference[] references = null; + if(activeWorkbenchWindow!=null){ + references = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage().getViewReferences(); + } + else if(PlatformUI.getWorkbench().getWorkbenchWindows().length>0){ + references = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getViewReferences(); + } + if(references!=null){ + for (IViewReference reference : references) { + if (reference.getId().equals(id)) { + return reference.getView(restore); + } + } + } return null; } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java index 735a2df5d..d0e40abf6 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java @@ -10,17 +10,21 @@ package eu.etaxonomy.taxeditor.model; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; +import java.util.Set; +import org.apache.commons.lang.StringUtils; import org.hibernate.LazyInitializationException; import eu.etaxonomy.cdm.api.service.DefaultCategoricalDescriptionBuilder; import eu.etaxonomy.cdm.api.service.DefaultQuantitativeDescriptionBuilder; import eu.etaxonomy.cdm.api.service.DescriptionBuilder; import eu.etaxonomy.cdm.common.CdmUtils; -import eu.etaxonomy.cdm.model.common.IIdentifiableEntity; -import eu.etaxonomy.cdm.model.common.ISourceable; +import eu.etaxonomy.cdm.model.common.CdmBase; +import eu.etaxonomy.cdm.model.common.Group; import eu.etaxonomy.cdm.model.common.IdentifiableEntity; import eu.etaxonomy.cdm.model.common.Language; import eu.etaxonomy.cdm.model.common.LanguageString; @@ -28,6 +32,10 @@ import eu.etaxonomy.cdm.model.common.LanguageStringBase; import eu.etaxonomy.cdm.model.common.Marker; import eu.etaxonomy.cdm.model.common.MarkerType; import eu.etaxonomy.cdm.model.common.OriginalSourceBase; +import eu.etaxonomy.cdm.model.common.RelationshipBase; +import eu.etaxonomy.cdm.model.common.RelationshipTermBase; +import eu.etaxonomy.cdm.model.common.Representation; +import eu.etaxonomy.cdm.model.common.User; import eu.etaxonomy.cdm.model.description.CategoricalData; import eu.etaxonomy.cdm.model.description.CommonTaxonName; import eu.etaxonomy.cdm.model.description.DescriptionBase; @@ -38,12 +46,27 @@ import eu.etaxonomy.cdm.model.description.Feature; import eu.etaxonomy.cdm.model.description.IndividualsAssociation; import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; import eu.etaxonomy.cdm.model.description.QuantitativeData; +import eu.etaxonomy.cdm.model.description.SpecimenDescription; +import eu.etaxonomy.cdm.model.description.TaxonDescription; import eu.etaxonomy.cdm.model.description.TaxonInteraction; +import eu.etaxonomy.cdm.model.description.TaxonNameDescription; import eu.etaxonomy.cdm.model.description.TextData; import eu.etaxonomy.cdm.model.location.NamedArea; import eu.etaxonomy.cdm.model.media.Media; +import eu.etaxonomy.cdm.model.name.HomotypicalGroup; +import eu.etaxonomy.cdm.model.name.HybridRelationship; +import eu.etaxonomy.cdm.model.name.NameRelationship; +import eu.etaxonomy.cdm.model.name.NameTypeDesignation; +import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; +import eu.etaxonomy.cdm.model.name.TaxonNameBase; +import eu.etaxonomy.cdm.model.name.TypeDesignationBase; +import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase; import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; +import eu.etaxonomy.cdm.model.taxon.Classification; +import eu.etaxonomy.cdm.model.taxon.SynonymRelationship; import eu.etaxonomy.cdm.model.taxon.Taxon; +import eu.etaxonomy.cdm.model.taxon.TaxonNode; +import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; import eu.etaxonomy.taxeditor.store.CdmStore; /** @@ -52,7 +75,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore; * @author p.ciardelli * @author n.hoffmann * @created 02.04.2009 - * @version 1.0 */ public class DescriptionHelper { @@ -66,6 +88,28 @@ public class DescriptionHelper { */ public static String getCache(DescriptionElementBase element, Language language) { + + String mainElementLabel= null; + DescriptionBase descr = element.getInDescription(); + if (descr != null){ + if (descr.isInstanceOf(TaxonDescription.class)){ + Taxon taxon = CdmBase.deproxy(descr, TaxonDescription.class).getTaxon(); + if (taxon != null){ + mainElementLabel = taxon.getTitleCache(); + } + }else if (descr.isInstanceOf(SpecimenDescription.class)){ + SpecimenOrObservationBase specimen = CdmBase.deproxy(descr, SpecimenDescription.class).getDescribedSpecimenOrObservation(); + if (specimen != null){ + mainElementLabel = specimen.getTitleCache(); + } + }else if (descr.isInstanceOf(TaxonNameDescription.class)){ + TaxonNameBase name = CdmBase.deproxy(descr, TaxonNameDescription.class).getTaxonName(); + if (name != null){ + mainElementLabel = name.getTitleCache(); + } + } + } + String cache = null; if (element instanceof TextData) { cache = ((TextData) element).getText(language); @@ -97,7 +141,11 @@ public class DescriptionHelper { } } } - return cache == null ? "" : cache; + String result = cache == null ? "" : cache; + if (StringUtils.isNotBlank(mainElementLabel)){ + result = CdmUtils.concat(" ", result, "(" + mainElementLabel + ")"); + } + return result; } /** @@ -124,19 +172,17 @@ public class DescriptionHelper { if (element instanceof TextData) { ((TextData) element).putText(language, value); return; - } - if (element instanceof CommonTaxonName) { + }else if (element instanceof CommonTaxonName) { ((CommonTaxonName) element).setName(value); return; - } - if (element instanceof TaxonInteraction) { + }else if (element instanceof TaxonInteraction) { - } - if(element instanceof Distribution){ + }else if(element instanceof Distribution){ MessagingUtils.warn(DescriptionHelper.class, "trying to set cache on distribution, don't know what to do at the moment."); return; + }else{ + MessagingUtils.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set."); } - MessagingUtils.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set."); } /** @@ -151,9 +197,7 @@ public class DescriptionHelper { setCache(element, value, CdmStore.getDefaultLanguage()); } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.IReferencingObjectsService#getObjectDescription(java.lang.Object) - */ + /** *

getObjectDescription

* @@ -169,10 +213,9 @@ public class DescriptionHelper { MessagingUtils.error(DescriptionHelper.class, result, e); return "TODO: " + result; } - } - if (element instanceof OriginalSourceBase) { + }else if (element instanceof OriginalSourceBase) { try{ - OriginalSourceBase originalSource = (OriginalSourceBase) element; + OriginalSourceBase originalSource = (OriginalSourceBase) element; // ISourceable sourcedObject = originalSource.getSourcedObj(); //due to #5743 the bidirectionality for sourced object had to be removed String sourceObjectTitle = "sourced object data not available (#5743)"; @@ -190,20 +233,180 @@ public class DescriptionHelper { MessagingUtils.error(DescriptionHelper.class, result, e); return "TODO: " + result; } - } - if (element instanceof LanguageStringBase) { + }else if (element instanceof LanguageStringBase) { return ((LanguageStringBase) element).getText(); - } - if (element instanceof DescriptionElementBase) { + }else if (element instanceof DescriptionElementBase) { return getCache((DescriptionElementBase) element); - } - if (element instanceof Marker) { + }else if (element instanceof RelationshipBase) { + return getCache((RelationshipBase) element); + }else if (element instanceof TypeDesignationBase) { + return getCache((TypeDesignationBase) element); + }else if (element instanceof HomotypicalGroup) { + return getCache((HomotypicalGroup) element); + }else if (element instanceof TaxonNode) { + return getCache((TaxonNode) element); + }else if (element instanceof Marker) { Marker marker = (Marker) element; MarkerType type = marker.getMarkerType(); return (type == null ? "- no marker type -" : marker.getMarkerType().getLabel()) + " (" + marker.getFlag() + ")"; + }else if (element instanceof User) { + User user = (User) element; + return user.getUsername(); + }else if (element instanceof Group) { + Group group = (Group) element; + return group.getName(); + }else{ + // TODO write return texts for HomotypicalGroup, etc. + return element.toString(); + } + } + + + private static String getCache(TaxonNode taxonNode) { + String result = ""; + Classification classification = taxonNode.getClassification(); + if (classification != null){ + String classificationStr = classification.getName() == null ? "" : classification.getName().getText(); + result = CdmUtils.concat("" , result, classificationStr); + if (StringUtils.isBlank(result)){ + result = classification.toString(); + } + } + String parentStr; + TaxonNode parentNode = taxonNode.getParent(); + if (parentNode == null){ + parentStr = "no parent"; + }else{ + Taxon parentTaxon = parentNode.getTaxon(); + if (parentTaxon == null){ + parentStr = "no parent taxon"; + }else{ + TaxonNameBase parentName = parentTaxon.getName(); + if (parentName == null){ + parentStr = parentTaxon.getTitleCache(); + }else{ + parentStr = parentName.getTitleCache(); + } + } + } + result = CdmUtils.concat(": ", result, parentStr); + + return null; + } + + private static String getCache(TypeDesignationBase designation) { + designation = CdmBase.deproxy(designation); + TypeDesignationStatusBase status = designation.getTypeStatus(); + Set from; + IdentifiableEntity to; + from = designation.getTypifiedNames(); + if (designation.isInstanceOf(SpecimenTypeDesignation.class)){ + to = ((SpecimenTypeDesignation)designation).getTypeSpecimen(); + }else if (designation.isInstanceOf(NameTypeDesignation.class)){ + to = ((NameTypeDesignation)designation).getTypeName(); + }else{ + throw new RuntimeException("Type Designation class not supported: " + designation.getClass().getName()); + } + String typeLabel = null; + if (status != null){ + Representation typeRepr = status.getPreferredRepresentation(CdmStore.getDefaultLanguage()); + if (typeRepr != null){ + typeLabel = typeRepr.getAbbreviatedLabel(); + } + if (StringUtils.isBlank(typeLabel) && typeRepr != null){ + typeLabel = typeRepr.getLabel(); + } + if (StringUtils.isBlank(typeLabel) ){ + typeLabel = status.getSymbol(); + } + if (StringUtils.isBlank(typeLabel)){ + typeLabel = status.getTitleCache(); + } + } + if (StringUtils.isBlank(typeLabel)){ + typeLabel = "->"; + } + String fromString = ""; + for (TaxonNameBase name : from){ + CdmUtils.concat(",", fromString, name.getTitleCache()); + } + String result = CdmUtils.concat(" ", new String[]{from == null ? null : fromString, + typeLabel, to == null? null : to.getTitleCache()}); + return result; + } + + private static String getCache(RelationshipBase rel) { + rel = CdmBase.deproxy(rel); + RelationshipTermBase type = rel.getType(); + IdentifiableEntity from; + IdentifiableEntity to; + if (rel.isInstanceOf(SynonymRelationship.class)){ + from = ((SynonymRelationship)rel).getSynonym(); + to = ((SynonymRelationship)rel).getAcceptedTaxon(); + }else if (rel.isInstanceOf(NameRelationship.class)){ + from = ((NameRelationship)rel).getFromName(); + to = ((NameRelationship)rel).getToName(); + }else if (rel.isInstanceOf(HybridRelationship.class)){ + from = ((HybridRelationship)rel).getParentName(); + to = ((HybridRelationship)rel).getHybridName(); + }else if (rel.isInstanceOf(TaxonRelationship.class)){ + from = ((TaxonRelationship)rel).getFromTaxon(); + to = ((TaxonRelationship)rel).getToTaxon(); + }else{ + try { + Method fromMethod = rel.getClass().getMethod("getRelatedFrom"); + Method toMethod = rel.getClass().getMethod("getRelatedFrom"); + fromMethod.setAccessible(true); + toMethod.setAccessible(true); + from = (IdentifiableEntity)fromMethod.invoke(rel); + to = (IdentifiableEntity)toMethod.invoke(rel); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } catch (SecurityException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + + } + String typeLabel = null; + if (type != null){ + Representation typeRepr = type.getPreferredRepresentation(CdmStore.getDefaultLanguage()); + if (typeRepr != null){ + typeLabel = typeRepr.getAbbreviatedLabel(); + } + if (StringUtils.isBlank(typeLabel) && typeRepr != null){ + typeLabel = typeRepr.getLabel(); + } + if (StringUtils.isBlank(typeLabel) ){ + typeLabel = type.getSymbol(); + } + if (StringUtils.isBlank(typeLabel)){ + typeLabel = type.getTitleCache(); + } } - // TODO write return texts for NameRelationship, HomotypicalGroup, SpecimenTypeDesignation, etc. - return element.toString(); + if (StringUtils.isBlank(typeLabel)){ + typeLabel = "->"; + } + String result = CdmUtils.concat(" ", new String[]{from == null ? null : from.getTitleCache(), + typeLabel, to == null? null : to.getTitleCache()}); + return result; + } + + + private static String getCache(HomotypicalGroup hg) { + String result = ""; + for (TaxonNameBase tnb : hg.getTypifiedNames()){ + result = CdmUtils.concat(", ", result, tnb.getTitleCache()); + } + if (StringUtils.isBlank(result)){ + result = "No typified names"; + } + return result; } /** diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java index 1947c452f..4d31df288 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java @@ -25,14 +25,11 @@ import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonWizardPage; */ public class NewTaxonWizard extends AbstractNewEntityWizard { - private TaxonWizardPage taxonWizardPage; - /** {@inheritDoc} */ @Override public void addPages() { + addPage(new TaxonWizardPage(formFactory, getConversationHolder(), getEntity())); addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), (NonViralName) getEntity().getName())); - taxonWizardPage = new TaxonWizardPage(formFactory, getConversationHolder(), getEntity()); - addPage(taxonWizardPage); } /** {@inheritDoc} */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java index 105bbd38b..aa04200f5 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java @@ -287,6 +287,8 @@ public abstract class AbstractMenuPreferences extends CdmStore.getTermManager().setPreferredTerms(preferredTerms, getTerms()); + refresh(getTerms()); + PreferencesUtil.firePreferencesChanged(this.getClass()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/RankMenuPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/RankMenuPreferences.java index 9c16f51bc..dfe837ca9 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/RankMenuPreferences.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/RankMenuPreferences.java @@ -1,8 +1,8 @@ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -37,7 +37,7 @@ public class RankMenuPreferences extends AbstractMenuPreferences implement *

Constructor for RankMenuPreferences.

*/ public RankMenuPreferences() { - super("Rank Preferences", + super("Rank Preferences", "Choose which ranks to display in the property sheet drop-down menu.", false); } @@ -48,25 +48,26 @@ public class RankMenuPreferences extends AbstractMenuPreferences implement /** {@inheritDoc} */ @Override protected void createAdditionalContent(Composite container) { - + final Button checkbox = new Button(container, SWT.CHECK); checkbox.setText("Sort ranks hierarchically (default is alphabetically)"); - + checkbox.setSelection(PreferencesUtil.getSortRanksHierarchichally()); - + checkbox.addSelectionListener(new SelectionAdapter() { /* (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(SelectionEvent e) { + PreferencesUtil.setSortRanksHierarchichally(checkbox.getSelection()); - refresh(getTerms()); + } }); - + } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.preference.menu.AbstractMenuPreferences#getTermClass() */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java index 7439f00a2..e5cad6866 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java @@ -33,6 +33,7 @@ import eu.etaxonomy.cdm.api.service.ICollectionService; import eu.etaxonomy.cdm.api.service.ICommonService; import eu.etaxonomy.cdm.api.service.INameService; import eu.etaxonomy.cdm.api.service.IOccurrenceService; +import eu.etaxonomy.cdm.api.service.IPolytomousKeyService; import eu.etaxonomy.cdm.api.service.IReferenceService; import eu.etaxonomy.cdm.api.service.IService; import eu.etaxonomy.cdm.api.service.IUserService; @@ -44,6 +45,7 @@ import eu.etaxonomy.cdm.model.agent.AgentBase; import eu.etaxonomy.cdm.model.common.CdmBase; import eu.etaxonomy.cdm.model.common.Language; import eu.etaxonomy.cdm.model.common.User; +import eu.etaxonomy.cdm.model.description.PolytomousKey; import eu.etaxonomy.cdm.model.molecular.Amplification; import eu.etaxonomy.cdm.model.molecular.Primer; import eu.etaxonomy.cdm.model.name.NonViralName; @@ -641,6 +643,8 @@ public class CdmStore { } else if (cdmBase instanceof Amplification) { service = (IService) getService(IAmplificationService.class); + } else if (cdmBase instanceof PolytomousKey) { + service = (IService) getService(IPolytomousKeyService.class); } } return service; diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java index 9520f97bc..9b49a293b 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java @@ -35,9 +35,12 @@ import eu.etaxonomy.cdm.model.common.DefinedTermBase; import eu.etaxonomy.cdm.model.metadata.CdmMetaData; import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; import eu.etaxonomy.cdm.model.name.Rank; +import eu.etaxonomy.taxeditor.Messages; +import eu.etaxonomy.taxeditor.model.AbstractUtility; import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource; +import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog; import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog; import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart; @@ -64,7 +67,7 @@ class CdmStoreConnector extends Job { ICdmSource cdmSource, DbSchemaValidation dbSchemaValidation, Resource applicationContextBean) { - super("Connecting to datasource: " + cdmSource); + super(String.format(Messages.CdmStoreConnector_CREATING_DATAMODEL, cdmSource)); this.display = display; this.cdmSource = cdmSource; this.dbSchemaValidation = dbSchemaValidation; @@ -110,52 +113,24 @@ class CdmStoreConnector extends Job { try { Thread.currentThread().setPriority(10); applicationController = getApplicationController(cdmSource,subprogressMonitor); + MessagingUtils.informationDialog(Messages.CdmStoreConnector_SUCCESS, Messages.CdmStoreConnector_DATA_MODEL_CREATION_SUCCESSFUL); + CdmDataSourceViewPart dataSourceView = (CdmDataSourceViewPart) AbstractUtility.getView("eu.etaxonomy.taxeditor.view.datasource", false); + if(dataSourceView!=null){ + dataSourceView.refresh(); + } + return Status.OK_STATUS; } catch (Exception e) { if(! causeIsCancelationExceptionRecursive(e)){ - return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + cdmSource.getName(), e); + MessagingUtils.errorDialog(Messages.CdmStoreConnector_COULD_NOT_CREATE_DATAMODEL, CdmStoreConnector.class, + String.format(Messages.CdmStoreConnector_ERROR_DURING_DATAMODEL_CREATION, cdmSource.getName()), TaxeditorStorePlugin.PLUGIN_ID, e, true); + return Status.CANCEL_STATUS; } } finally { monitor.done(); Thread.currentThread().setPriority(oldPriority); } } - - - - if (!monitor.isCanceled()) { - CdmStore.setInstance(applicationController, cdmSource); - - display.asyncExec(new Runnable() { - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - authenticate(); - - startContext(); - } - }); - - MessagingUtils.info("Application context initialized."); - return Status.OK_STATUS; - } else { - // Show datasource view if not shown yet - display.asyncExec(new Runnable() { - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - StoreUtil.showView(CdmDataSourceViewPart.ID); - } - }); - return Status.CANCEL_STATUS; - } + return Status.CANCEL_STATUS; } @@ -214,7 +189,7 @@ class CdmStoreConnector extends Job { if (!monitor.isCanceled()) { CdmStore.setInstance(applicationController, cdmSource); - monitor.subTask("Authenticating user"); + monitor.subTask(Messages.CdmStoreConnector_AUTHENTICATING_USER); display.syncExec(new Runnable() { /* * (non-Javadoc) @@ -312,7 +287,7 @@ class CdmStoreConnector extends Job { * @throws SQLException */ private void checkDbSchemaVersionCompatibility(IProgressMonitor monitor) { - monitor.subTask("Checking if datasource is compatible with this editor."); + monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_EDITOR_IS_COMPATIBLE); String dbSchemaVersion; String message = null; @@ -326,9 +301,9 @@ class CdmStoreConnector extends Job { // if the datasource version is greater than the taxeditor compatible version then the taxeditor needs to // be updated else the datasource needs to be updated if(compareVersion > 0) { - message = "Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible datasource"; + message = Messages.CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE; } else if (compareVersion < 0) { - message = "Please update the chosen datasource or choose a new data source to connect to in the Datasource View."; + message = Messages.CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE; } } monitor.worked(1); @@ -340,13 +315,9 @@ class CdmStoreConnector extends Job { // Show an error message MessagingUtils .messageDialog( - "Datasource Compatibility Check failed", + Messages.CdmStoreConnector_COMPATIBILITY_CHECK_FAILED, this, - "The database schema for the chosen " - + "datasource '" - + cdmSource - + "' \n is not compatible for this version of the taxonomic editor. \n\n" - + message, + String.format(Messages.CdmStoreConnector_SCHEME_NOT_COMPATIBLE, cdmSource, message), null); monitor.setCanceled(true); @@ -355,7 +326,7 @@ class CdmStoreConnector extends Job { } private void checkIsNonEmptyCdmDatabase(IProgressMonitor monitor) { - monitor.subTask("Checking if datasource is a non empty CDM database."); + monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_NON_EMPTY); boolean isDbEmpty = false; try { isDbEmpty = cdmSource.isDbEmpty(); @@ -379,12 +350,12 @@ class CdmStoreConnector extends Job { private void checkDatabaseReachable(IProgressMonitor monitor) { try { - monitor.subTask("Checking if datasource is reachable."); + monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_REACHABLE); cdmSource.checkConnection(); monitor.worked(1); } catch (CdmSourceException e) { - MessagingUtils.messageDialog("Could not connect to chosen datasource", - this, "Reason: " + e.getMessage(), e); + MessagingUtils.messageDialog(Messages.CdmStoreConnector_COULD_NOT_CONNECT_TO_CHOSEN_DATASOURCE, + this, Messages.CdmStoreConnector_REASON + e.getMessage(), e); monitor.setCanceled(true); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java index 92824fcd6..f77ab9033 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java @@ -735,7 +735,7 @@ public class RemotingLoginDialog extends Dialog implements ICDMServerError { // the following loop is a 'fake' progress monitoring where the progress // bar is advanced by one unit every second until maxUnits -2 - while(!CdmStore.getManagedServer().isStarted()) { + while(!CdmStore.getManagedServer().isStarted() && !CdmStore.getManagedServer().isFailed()) { if(serverUnits < maxUnits - 2) { try { Thread.sleep(1000); @@ -748,10 +748,10 @@ public class RemotingLoginDialog extends Dialog implements ICDMServerError { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - hide(false); - updateManagedServerControls(); - connect(); - } + hide(false); + updateManagedServerControls(); + connect(); + } }); } catch (IOException ioe) { MessagingUtils.errorDialog("Error generating server config file", diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java new file mode 100644 index 000000000..7aa0dd9ff --- /dev/null +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java @@ -0,0 +1,84 @@ +// $Id$ +/** +* Copyright (C) 2016 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.taxeditor.ui.dialog.selection; + +import org.eclipse.swt.widgets.Shell; + +import eu.etaxonomy.cdm.api.conversation.ConversationHolder; +import eu.etaxonomy.cdm.api.service.IAgentService; +import eu.etaxonomy.cdm.model.agent.AgentBase; +import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; +import eu.etaxonomy.taxeditor.store.CdmStore; + +/** + * @author k.luther + * @date 25.05.2016 + * + */ +public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog { + + + /** + * @param shell + * @param conversation + * @param title + * @param multi + * @param settings + * @param agent + */ + protected NomenclaturalAuthorSelectionDialog(Shell shell, ConversationHolder conversation, String title, + boolean multi, String settings, AgentBase agent) { + super(shell, conversation, title, multi, settings, agent); + // TODO Auto-generated constructor stub + } + + @Override + protected void initModel() { + model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(); + } + + /** + *

select

+ * + * @param shell a {@link org.eclipse.swt.widgets.Shell} object. + * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. + * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. + * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object. + */ + public static AgentBase select(Shell shell, ConversationHolder conversation, AgentBase entity) { + NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, conversation, + "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity); + return getSelectionFromDialog(dialog); + } + + /** + *

getTitle

+ * + * @param cdmObject a T object. + * @return a {@link java.lang.String} object. + */ + @Override + protected String getTitle(AgentBase cdmObject) { + if(cdmObject == null){ + return ""; + } + + if (cdmObject instanceof TeamOrPersonBase) { + return ((TeamOrPersonBase) cdmObject).getNomenclaturalTitle(); + } else if (cdmObject instanceof AgentBase){ + return ((TeamOrPersonBase) cdmObject).getTitleCache(); + } + + throw new IllegalArgumentException("Generic method only" + + " supports cdmObject of type IIdentifiableEntity." + + " Please implement specific method in subclass."); + } + +} diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java index 37c0501d0..3a31d6fc9 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -33,7 +33,7 @@ public class PolytomousKeySelectionDialog extends "Choose Polytomous Key", false, PolytomousKeySelectionDialog.class.getCanonicalName(), key); return getSelectionFromDialog(dialog); } - + /** * @param shell * @param conversation diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java index a4754ca91..0bba39ae2 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java @@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.Shell; import eu.etaxonomy.cdm.api.conversation.ConversationHolder; import eu.etaxonomy.cdm.api.service.IReferenceService; import eu.etaxonomy.cdm.model.reference.Reference; -import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceDefaultCacheStrategy; +import eu.etaxonomy.cdm.strategy.cache.reference.DefaultReferenceCacheStrategy; import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; import eu.etaxonomy.taxeditor.newWizard.NewReferenceWizard; import eu.etaxonomy.taxeditor.store.CdmStore; @@ -87,7 +87,7 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti }else if(cdmObject.getAuthorship() == null){ return super.getTitle(cdmObject); }else{ - return ReferenceDefaultCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorship().getTitleCache()); + return DefaultReferenceCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorship().getTitleCache()); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java index a90ce1c9b..70cdd0fb3 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java @@ -44,6 +44,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; import eu.etaxonomy.taxeditor.ui.element.IEntityElement; +import eu.etaxonomy.taxeditor.ui.section.name.AuthorshipDetailElement; /** * @author n.hoffmann @@ -82,10 +83,13 @@ public class SelectionDialogFactory { if(clazz.equals(Team.class)){ return (T) TeamSelectionDialog.select(shell, conversation, (Team) currentSelection); } - if(clazz.equals(TeamOrPersonBase.class)){ + if(clazz.equals(TeamOrPersonBase.class) && parentElement instanceof AuthorshipDetailElement){ + return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection); + }else if(clazz.equals(TeamOrPersonBase.class)){ //TODO: add TeamOrPersonBaseSelectionDialog (see ticket #4545) return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection); } + if(clazz.equals(AgentBase.class)){ return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection); } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java index 5ad3ae4ec..1d3c646a8 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java @@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.ui.element; import java.text.ParseException; +import org.apache.commons.lang.StringUtils; import org.eclipse.jface.util.PropertyChangeEvent; import eu.etaxonomy.cdm.model.common.TermType; @@ -102,11 +103,18 @@ public class PointElement extends AbstractCdmFormElement implements Object eventSource = event.getSource(); if (eventSource == text_latitude) { try { - getPoint().setLatitudeByParsing(text_latitude.getText()); - text_latitudeParsed.setText(point.getLatitudeSexagesimal() - .toString(false)); - text_latitude - .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + if (StringUtils.isBlank(text_latitude.getText())){ + getPoint().setLatitudeByParsing(null); + text_latitudeParsed.setText(null); + text_latitude + .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + }else{ + getPoint().setLatitudeByParsing(text_latitude.getText()); + text_latitudeParsed.setText(point.getLatitudeSexagesimal() + .toString(false)); + text_latitude + .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + } propagate = true; } catch (ParseException e) { text_latitude @@ -114,11 +122,18 @@ public class PointElement extends AbstractCdmFormElement implements } } else if (eventSource == text_longitude) { try { - getPoint().setLongitudeByParsing(text_longitude.getText()); - text_longitudeParsed.setText(point.getLongitudeSexagesimal() - .toString(false)); - text_longitude - .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + if (StringUtils.isBlank(text_longitude.getText())){ + getPoint().setLongitudeByParsing(null); + text_longitudeParsed.setText(null); + text_longitude + .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + }else{ + getPoint().setLongitudeByParsing(text_longitude.getText()); + text_longitudeParsed.setText(point.getLongitudeSexagesimal() + .toString(false)); + text_longitude + .setBackground(getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); + } propagate = true; } catch (ParseException e) { text_longitude diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java index 0a583772d..c929611d6 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java @@ -79,7 +79,7 @@ public class ClassificationDetailElement extends @Override protected void createControls(ICdmFormElement formElement, Classification entity, int style) { - text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getTitleCache() : null, SWT.NULL); + text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getName().getText() : null, SWT.NULL); selection_reference = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Reference", entity != null ? entity.getReference() : null, EntitySelectionElement.ALL, SWT.NULL); text_microReference = formFactory.createTextWithLabelElement(formElement, "Reference Detail", diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java index 8a576ef93..ef3c71417 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java @@ -14,12 +14,13 @@ import org.eclipse.swt.events.SelectionListener; import eu.etaxonomy.cdm.model.common.DefinedTerm; import eu.etaxonomy.cdm.model.common.TermType; -import eu.etaxonomy.cdm.model.description.TaxonDescription; +import eu.etaxonomy.cdm.model.description.PolytomousKey; import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; +import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection; /** *

ScopeElement class.

@@ -51,8 +52,9 @@ public class ScopeElement extends AbstractEntityCollectionElement { @Override public void setEntity(DefinedTerm entity) { this.entity = entity; - if(!entity.getLabel().isEmpty()){ + if(entity.getId()!=0){ combo_scope.setSelection(entity); + combo_scope.removeEmptyElement(); } } @@ -67,10 +69,10 @@ public class ScopeElement extends AbstractEntityCollectionElement { public void handleEvent(Object eventSource) { DefinedTerm scopeTerm = combo_scope.getSelection(); if(eventSource==combo_scope && scopeTerm!=null){ - if(getParentElement() instanceof ScopeSection){ - TaxonDescription taxonDescription = ((ScopeSection)getParentElement()).getEntity(); - taxonDescription.removeScope(entity); - taxonDescription.addScope(scopeTerm); + if(getParentElement() instanceof ScopeRestrictionSection){ + PolytomousKey key = ((ScopeRestrictionSection)getParentElement()).getEntity(); + key.removeScopeRestriction(entity); + key.addScopeRestriction(scopeTerm); entity = scopeTerm; } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java index 6981bc661..49177b025 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java @@ -64,19 +64,13 @@ public class PolytomousKeyNodeDetailElement extends element_statement = formFactory.createKeyStatementElement(formElement, "State(ment)", entity.getStatement(), 50, style); - if (entity.isLeaf()) { - selection_taxon = formFactory - .createSelectionElement(Taxon.class, - getConversationHolder(), formElement, "Taxon", - entity.getTaxon(), EntitySelectionElement.NOTHING, - style); - } else{ - selection_taxon = formFactory - .createSelectionElement(Taxon.class, - getConversationHolder(), formElement, "Taxon", - entity.getTaxon(), EntitySelectionElement.DELETABLE, - style); - } + + selection_taxon = formFactory + .createSelectionElement(Taxon.class, + getConversationHolder(), formElement, "Taxon", + entity.getTaxon(), EntitySelectionElement.DELETABLE, + style); + selection_subkey = formFactory .createSelectionElement(PolytomousKey.class, diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java index a0c12f1ae..4735ccd5a 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java @@ -11,21 +11,22 @@ import eu.etaxonomy.cdm.model.common.TermType; import eu.etaxonomy.cdm.model.description.PolytomousKey; import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; -import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; +import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection; /** * @author n.hoffmann * */ -public class ScopeRestrictionSection extends AbstractEntityCollectionSection { +public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSection { public ScopeRestrictionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) { super(formFactory, conversation, parentElement, "Scope Restriction", style); } + @Override - public Collection getCollection(PolytomousKey entity) { + protected Collection getEntityCollection(PolytomousKey entity) { return entity.getScopeRestrictions(); } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java index 8f444705e..ebc15fbe3 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -33,10 +33,9 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection; * * @author n.hoffmann * @created Nov 5, 2009 - * @version 1.0 */ public class ProtologueSection extends AbstractEntityCollectionSection implements ITaxonBaseDetailSection{ - + private TaxonBase taxonBase; /** @@ -97,16 +96,17 @@ public class ProtologueSection extends AbstractEntityCollectionSection descriptions = getTaxonNameDescriptions(getEntity()); for (TaxonNameDescription desc : descriptions){ desc.removeElement(element); - } + } } /** {@inheritDoc} */ - public void setTaxonBase(TaxonBase entity) { + @Override + public void setTaxonBase(TaxonBase entity) { this.taxonBase = entity; - NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class); + NonViralName name = HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class); setEntity(name); } - + /** * NOTE: returns first description * @param name @@ -118,7 +118,7 @@ public class ProtologueSection extends AbstractEntityCollectionSection selection_collection; private TextWithLabelElement text_accessionNumber; private GatheringEventUnitElement element_elevation; + private UriWithLabelElement uriPreferredStableUri; private CheckboxElement checkIsPublish; - /** - * @param formFactory - * @param formElement - */ public DerivedUnitGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) { super(formFactory, formElement); @@ -122,6 +120,7 @@ public class DerivedUnitGeneralDetailElement extends text_accessionNumber = formFactory.createTextWithLabelElement( formElement, "Accession Number", entity.getAccessionNumber(), style); + uriPreferredStableUri = formFactory.createUriWithLabelElement(formElement, "Pref. Stable URI", entity.getPreferredStableUri(), style); checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style); } @@ -153,9 +152,11 @@ public class DerivedUnitGeneralDetailElement extends getEntity().setAccessionNumber(text_accessionNumber.getText()); } else if (eventSource == combo_specorobstype) { getEntity().setType(combo_specorobstype.getSelection()); + } else if (eventSource == uriPreferredStableUri) { + getEntity().setPreferredStableUri(uriPreferredStableUri.parseText()); } else if (eventSource == checkIsPublish) { - getEntity().innerDerivedUnit().setPublish(checkIsPublish.getSelection()); - } + getEntity().innerDerivedUnit().setPublish(checkIsPublish.getSelection()); + } if (eventSource != toggleableText_titleCache) { toggleableText_titleCache.setText(getEntity().getTitleCache()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailElement.java index 0b6e10994..5561170f2 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailElement.java @@ -26,13 +26,13 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; * @date 07.01.2014 * */ -public class SequenceReferenceCollectionDetailElement extends AbstractEntityCollectionElement>{ +public class SequenceReferenceCollectionDetailElement extends AbstractEntityCollectionElement{ protected EntitySelectionElement selection_reference; protected TextWithLabelElement text_referenceDetail; public SequenceReferenceCollectionDetailElement(CdmFormFactory formFactory, - AbstractFormSection section, Reference entity, + AbstractFormSection section, Reference entity, SelectionListener removeListener, int style) { super(formFactory, section, entity, removeListener, null, style); } @@ -49,7 +49,7 @@ public class SequenceReferenceCollectionDetailElement extends AbstractEntityColl } @Override - public void setEntity(Reference entity) { + public void setEntity(Reference entity) { this.entity = entity; selection_reference.setEntity(entity); text_referenceDetail.setText(entity.getReferenceAbstract()); @@ -61,7 +61,7 @@ public class SequenceReferenceCollectionDetailElement extends AbstractEntityColl if(getParentElement() instanceof SequenceReferenceCollectionDetailSection){ Sequence sequence = ((SequenceReferenceCollectionDetailSection) getParentElement()).getEntity(); sequence.removeCitation(entity); - Reference newCitation = selection_reference.getSelection(); + Reference newCitation = selection_reference.getSelection(); sequence.addCitation(newCitation); entity = newCitation; diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java index 840631c75..9d7e3449e 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java @@ -80,7 +80,7 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement< text_accessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style); //the first PrimaryMediaSource is used for storing the reference - Reference publishedIn = null; + Reference publishedIn = null; for(IdentifiableSource source:media.getSources()){ if(source.getType()==OriginalSourceType.PrimaryMediaSource){ publishedIn = source.getCitation(); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java index 1f26a8bc2..abbc234a2 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java @@ -120,7 +120,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem "Title", entity.getTitle(), style); // abbreviated title text_abbrevTitle = formFactory.createTextWithLabelElement(formElement, - "Abbrev. Title", entity.getAbbrevTitle(), style); + "Nomenclatural Title", entity.getAbbrevTitle(), style); // author team selection_authorTeam = formFactory @@ -435,12 +435,16 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem getEntity().setReferenceAbstract(text_referenceAbstract.getText()); } else if (eventSource == text_series) { getEntity().setSeriesPart(text_series.getText()); - } else if (eventSource == text_title) { + } else if (eventSource == text_title ) { getEntity().setTitle(text_title.getText()); - toggleable_cache.setText(text_title.getText()); - } else if (eventSource == text_abbrevTitle) { + if (!toggleable_cache.isEnabled()){ + toggleable_cache.setText(getEntity().generateTitle()); + } + } else if (eventSource == text_abbrevTitle ) { getEntity().setAbbrevTitle(text_abbrevTitle.getText()); - toggleableAbbrevCache.setText(text_abbrevTitle.getText()); + if (!toggleableAbbrevCache.isEnabled()){ + toggleableAbbrevCache.setText(getEntity().generateAbbrevTitle()); + } } else if (eventSource == text_uri) { getEntity().setUri(text_uri.parseText()); } else if (eventSource == text_volume) { diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java index b086a1857..8bed51e69 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java @@ -50,6 +50,8 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem private EntitySelectionElement selection_secundum; + private TextWithLabelElement text_secundum_microreference; + private TextWithLabelElement text_appendedPhrase; private CheckboxElement checkbox_excluded; @@ -92,30 +94,36 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){ text_appendedPhrase = formFactory.createTextWithLabelElement( formElement, "Appended Phrase", entity.getAppendedPhrase(), - SWT.NULL); + SWT.WRAP); + //formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style); } selection_secundum = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Secundum", entity.getSec(), EntitySelectionElement.ALL, style); - + + text_secundum_microreference = formFactory.createTextWithLabelElement( + formElement, "Micro Reference", + entity.getSecMicroReference(),null, + SWT.WRAP); + // TODO RL if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)) { checkbox_useNameCache = formFactory.createCheckbox(formElement, "Exclude Authorship", entity.isUseNameCache(), style); - + if (entity instanceof Taxon) { checkbox_excluded = formFactory.createCheckbox(formElement, "Taxon is excluded", ((Taxon) entity).isExcluded(), style); checkbox_unplaced = formFactory.createCheckbox(formElement, "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style); } - + checkbox_doubtful = formFactory.createCheckbox(formElement, entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style); } - + if (entity instanceof Taxon) { checkbox_published = formFactory.createCheckbox(formElement, "Taxon is published", ((Taxon) entity).isPublish(), style); @@ -149,7 +157,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem super.updateContent(); toggleable_cache.setEnabled(getEntity().isProtectedTitleCache()); setIrrelevant(toggleable_cache.getState(), - Arrays.asList(new Object[] { toggleable_cache })); + Arrays.asList(new Object[] { toggleable_cache, checkbox_published, checkbox_unplaced, checkbox_excluded })); } @Override @@ -172,7 +180,9 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem getEntity().setSec(selection_secundum.getSelection()); } else if (eventSource == text_appendedPhrase) { getEntity().setAppendedPhrase(text_appendedPhrase.getText()); - } else if (eventSource == checkbox_excluded) { + }else if (eventSource == text_secundum_microreference) { + getEntity().setSecMicroReference(text_secundum_microreference.getText()); + }else if (eventSource == checkbox_excluded) { ((Taxon) getEntity()).setExcluded(checkbox_excluded.getSelection()); } else if (eventSource == checkbox_unplaced) { ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection()); @@ -185,7 +195,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem boolean pushedState = toggleable_cache.getState(); getEntity().setTitleCache(toggleable_cache.getText(), pushedState); - setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_appendedPhrase, checkbox_published, checkbox_unplaced, checkbox_excluded})); + setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, checkbox_published, checkbox_unplaced, checkbox_excluded})); updateToggleableCacheField(); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java index b5d8ec626..90e158404 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java @@ -26,6 +26,9 @@ public class DefinedTermDetailElement extends Abstrac protected TextWithLabelElement textIdInVocabulary; + protected TextWithLabelElement textSymbol; + + /** * @param formFactory * @param formElement @@ -39,6 +42,7 @@ public class DefinedTermDetailElement extends Abstrac protected void createControls(ICdmFormElement formElement, T entity, int style) { super.createControls(formElement, entity, style); textIdInVocabulary = formFactory.createTextWithLabelElement(formElement, "ID in vocabulary", entity.getIdInVocabulary(), style); + textSymbol = formFactory.createTextWithLabelElement(formElement, "Symbol", entity.getSymbol(), style); }; /* (non-Javadoc) @@ -53,8 +57,16 @@ public class DefinedTermDetailElement extends Abstrac }else{ getEntity().setIdInVocabulary(textIdInVocabulary.getText()); } - + } + if(eventSource==textSymbol){ + if (StringUtils.isBlank(textSymbol.getText())){ + getEntity().setSymbol(null); + }else{ + getEntity().setSymbol(textIdInVocabulary.getText()); + } + + } } /* (non-Javadoc) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java index adcbfeccd..5e76e56c6 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java @@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.model.agent.Person; import eu.etaxonomy.cdm.model.agent.Team; import eu.etaxonomy.cdm.model.common.CdmBase; import eu.etaxonomy.cdm.model.common.User; +import eu.etaxonomy.cdm.model.description.PolytomousKey; import eu.etaxonomy.cdm.model.molecular.Amplification; import eu.etaxonomy.cdm.model.molecular.Primer; import eu.etaxonomy.cdm.model.name.NonViralName; @@ -41,6 +42,7 @@ import eu.etaxonomy.cdm.model.reference.Reference; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.model.TextHelper; import eu.etaxonomy.taxeditor.newWizard.AmplificationGeneralWizardPage; +import eu.etaxonomy.taxeditor.newWizard.PolytomousKeyWizardPage; import eu.etaxonomy.taxeditor.newWizard.PrimerWizardPage; import eu.etaxonomy.taxeditor.preference.PreferencesUtil; import eu.etaxonomy.taxeditor.session.ICdmEntitySession; @@ -92,7 +94,6 @@ public class EditFromSelectionWizard extends Wizard implements //check if entity has already been persisted if(entity.getId()==0){ rootElement = entity; - cdmEntitySession.addNewCdmEntity(rootElement); } else{ IService service = CdmStore.getService(entity); @@ -162,6 +163,10 @@ public class EditFromSelectionWizard extends Wizard implements addPage(new AmplificationGeneralWizardPage(formFactory, selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Amplification.class))); + } else if (rootElement instanceof PolytomousKey) { + addPage(new PolytomousKeyWizardPage(formFactory, + selectionElement.getConversationHolder(), + HibernateProxyHelper.deproxy(rootElement, PolytomousKey.class))); } else { MessagingUtils.warningDialog("Missing interface", this, "No detail element for current selection"); @@ -204,7 +209,7 @@ public class EditFromSelectionWizard extends Wizard implements cdmEntitySession.dispose(); } if(previousCdmEntitySession!=null){ - previousCdmEntitySession.dispose(); + previousCdmEntitySession.bind(); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java index 2c140c247..ba5e5c463 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java @@ -44,8 +44,7 @@ public class ChangeConnectionHandler extends AbstractHandler { try { container.getCdmSource().checkConnection(); - boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CONFIRM_DATASOURCE, Messages.ChangeConnectionHandler_REALLY_WANT_TO_CONNECT - + container.getCdmSource().getName()); + boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CREATE_DATAMODEL, String.format(Messages.ChangeConnectionHandler_REALLY_CREATE_DATAMODEL, container.getCdmSource().getName())); if(confirmed){ CdmDataSourceRepository.changeDataSource(container.getCdmSource()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/CloseConnectionHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/CloseConnectionHandler.java deleted file mode 100644 index 62867a118..000000000 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/CloseConnectionHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ -/** -* Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy -* http://www.e-taxonomy.eu -* -* The contents of this file are subject to the Mozilla Public License Version 1.1 -* See LICENSE.TXT at the top of this package for the full license terms. -*/ - -package eu.etaxonomy.taxeditor.view.datasource.handler; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import eu.etaxonomy.taxeditor.store.CdmStore; -import eu.etaxonomy.taxeditor.store.StoreUtil; -import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart; - -/** - *

CloseConnectionHandler class.

- * - * @author n.hoffmann - * @created Mar 22, 2010 - * @version 1.0 - */ -public class CloseConnectionHandler extends AbstractHandler { - - /* (non-Javadoc) - * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) - */ - /** {@inheritDoc} */ - public Object execute(ExecutionEvent event) throws ExecutionException { - Shell shell = HandlerUtil.getActiveShell(event); - - boolean confirmed = MessageDialog.openConfirm(shell, "Confirm Datasource Close", "Do you really want to close the datasource connection?\n\n"); - - if(confirmed){ - CdmStore.close(StoreUtil.getMonitor()); - } - - CdmDataSourceViewPart view = (CdmDataSourceViewPart) StoreUtil.getView(CdmDataSourceViewPart.ID, true); - - view.refresh(); - - return null; - } -} diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DataSourceMenuPropertyTester.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DataSourceMenuPropertyTester.java index a8a01defa..622b5f4da 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DataSourceMenuPropertyTester.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DataSourceMenuPropertyTester.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT - * European Distributed Institute of Taxonomy + * European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu - * + * * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -13,11 +13,10 @@ package eu.etaxonomy.taxeditor.view.datasource.handler; import org.eclipse.core.expressions.PropertyTester; import org.eclipse.jface.viewers.IStructuredSelection; +import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName; import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer; /** - *

DataSourceMenuPropertyTester class.

- * * @author n.hoffmann * @created Sep 23, 2010 * @version 1.0 @@ -26,20 +25,14 @@ public class DataSourceMenuPropertyTester extends PropertyTester { private static final String COMPATIBLE = "isCompatible"; private static final String TEST = "test"; + private static final String HAS_DATA_MODEL = "hasDataModel"; - /* - * (non-Javadoc) - * - * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, - * java.lang.String, java.lang.Object[], java.lang.Object) - */ /** {@inheritDoc} */ @Override public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { Object[] selectedElements = ((IStructuredSelection) receiver).toArray(); - if (selectedElements.length == 0 && property.equals(TEST)) { // nothing selected so all tests should fail return true; @@ -52,21 +45,33 @@ public class DataSourceMenuPropertyTester extends PropertyTester { if (COMPATIBLE.equals(property)) { return isCompatible(selectedElements); } - - - - + if (HAS_DATA_MODEL.equals(property)) { + return hasDataModel(selectedElements); + } return false; } + private boolean hasDataModel(Object[] selectedElements) { + + if (selectedElements.length == 0 ) { + // nothing selected so all tests should fail + return false; + } + for (Object object : selectedElements) { + + if (object instanceof CdmMetaDataAwareDataSourceContainer) { + CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) object; + String schemaVersion = container.getMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION); + return !schemaVersion.equals(CdmMetaDataAwareDataSourceContainer.DEFAULT_ENTRY); + } + } + return false; + + } - /** - * @param selectedElements - * @return - */ private boolean isCompatible(Object[] selectedElements) { - + if (selectedElements.length == 0 ) { // nothing selected so all tests should fail return false; @@ -79,6 +84,6 @@ public class DataSourceMenuPropertyTester extends PropertyTester { } } return false; - + } } diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java index 99396b4c8..18dfb3ba0 100644 --- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java +++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java @@ -49,7 +49,8 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager; @Transactional(TransactionMode.DISABLED) @SpringApplicationContext("file:./target/classes/eu/etaxonomy/cdm/testRemotingApplicationContext.xml") public abstract class BaseRemotingTest extends ThreadedTest { - private static final Logger logger = Logger.getLogger(BaseRemotingTest.class); + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(BaseRemotingTest.class); private static ICdmRemoteSource cdmRemoteSource; private static CdmPersistentRemoteSource remotePersistentSource; diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java index e78d31d48..02d805cb4 100644 --- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java +++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/CdmServerTest.java @@ -18,6 +18,7 @@ import org.apache.log4j.Logger; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.osgi.framework.Bundle; @@ -45,6 +46,8 @@ public class CdmServerTest extends TestConfig { } @Test + @Ignore + //FIXME: remove @ignore and fix test public void manageCdmServer() throws IOException, URISyntaxException, CDMEmbeddedServerException { Bundle bundle = Platform.getBundle("eu.etaxonomy.taxeditor.test"); URL mgdDatasourcesConfigURL = bundle.getEntry("src/test/resources/.cdmLibrary/writableResources/mgd.datasources.xml"); diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java index a54143cd2..2cae0cd09 100644 --- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java +++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java @@ -10,6 +10,7 @@ package eu.etaxonomy.taxeditor.session; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -19,10 +20,12 @@ import java.util.UUID; import org.apache.log4j.Logger; import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.unitils.dbunit.annotation.DataSet; import eu.etaxonomy.cdm.api.application.CdmApplicationState; +import eu.etaxonomy.cdm.api.service.DeleteResult; import eu.etaxonomy.cdm.api.service.ICommonService; import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService; import eu.etaxonomy.cdm.api.service.IPolytomousKeyService; @@ -30,6 +33,7 @@ import eu.etaxonomy.cdm.api.service.ITaxonService; import eu.etaxonomy.cdm.api.service.ITermService; import eu.etaxonomy.cdm.api.service.IUserService; import eu.etaxonomy.cdm.api.service.IVocabularyService; +import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; import eu.etaxonomy.cdm.model.agent.AgentBase; import eu.etaxonomy.cdm.model.agent.Person; import eu.etaxonomy.cdm.model.common.CdmBase; @@ -86,6 +90,7 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest { @Test + @Ignore public void readAllPolytomousKeys() { List pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null); Iterator pKeysItr = pKeys.iterator(); @@ -339,10 +344,35 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest { PolytomousKeyNode rootNode = pKey.getRoot(); - PolytomousKeyNode child = rootNode.getChildAt(0); - PolytomousKey subKey = child.getSubkey(); - polytomousKeyService.delete(subKey.getUuid()); + PolytomousKeyNode childNode = rootNode.getChildAt(0); + PolytomousKey subKey = HibernateProxyHelper.deproxy( childNode.getSubkey(), PolytomousKey.class);; + + + DeleteResult result = polytomousKeyService.delete(subKey.getUuid()); + //A used subKey can't be deleted + if (result.isOk()){ + Assert.fail(); + } + + + Set ids = new HashSet(); + ids.add(2753); + ids.add(2754); + ids.add(2751); + List nodes = polytomousKeyNodeService.findById(ids); + for (PolytomousKeyNode child:nodes){ + child.setSubkey(null); + // polytomousKeyNodeService.merge(child); + } + polytomousKeyNodeService.merge(nodes, true); + result = polytomousKeyService.delete(subKey.getUuid()); + if (!result.isOk()){ + Assert.fail(); + } + + + // retrieving subkey shows its null subKey = CdmBase.deproxy(polytomousKeyService.find(subKeyUuid),PolytomousKey.class); @@ -351,14 +381,6 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest { pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class); - rootNode = pKey.getRoot(); - child = rootNode.getChildAt(0); - subKey = child.getSubkey(); - // subkey will not be null, because the delete functionality of the subkey - // does not currently delete it from a polytomous key node - - // FIXME: With the new delete functionality this should be null, shouldn't it ? - Assert.assertNotNull(subKey); } diff --git a/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml b/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml index c352d500f..5a1c1a210 100644 --- a/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml +++ b/eu.etaxonomy.taxeditor.test/src/test/resources/.cdmLibrary/writableResources/test.mgd.datasources.xml @@ -16,6 +16,6 @@ - + diff --git a/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF index 36406d4b2..0520a7c59 100644 --- a/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Webapp Bundle-SymbolicName: eu.etaxonomy.taxeditor.webapp;singleton:=true -Bundle-Version: 4.0.0 +Bundle-Version: 4.1.0 Require-Bundle: org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy diff --git a/eu.etaxonomy.taxeditor.webapp/pom.xml b/eu.etaxonomy.taxeditor.webapp/pom.xml index d15c50b41..4801e8205 100644 --- a/eu.etaxonomy.taxeditor.webapp/pom.xml +++ b/eu.etaxonomy.taxeditor.webapp/pom.xml @@ -4,7 +4,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 eu.etaxonomy.taxeditor.webapp @@ -127,11 +127,6 @@ h2 ${h2.version} - - com.h2database - h2 - ${h2.version} - mysql mysql-connector-java diff --git a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java index 98e68a5d4..76ed34164 100644 --- a/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java +++ b/eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java @@ -106,6 +106,7 @@ public class CDMServer { WebAppContext webapp = new WebAppContext(); webapp.setContextPath(contextPath); webapp.setWar(warFile.getAbsolutePath()); + webapp.setThrowUnavailableOnStartupException(true); server.setHandler(webapp); } @@ -183,7 +184,13 @@ public class CDMServer { server.start(); server.join(); } catch (Throwable t) { - cdmServerError.handleError(t); + //wait for 1sec to get the right order of login dialog and error + //message when connection fails + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + cdmServerError.handleError(new RuntimeException("Error during CDM server startup", t)); } } }; @@ -204,6 +211,10 @@ public class CDMServer { return server.isStarted(); } + public boolean isFailed() { + return server.isFailed(); + } + public void stop() throws Exception { server.stop(); server.destroy(); diff --git a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product index 0b6046b48..d7443b680 100644 --- a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product +++ b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product @@ -1,5 +1,5 @@ - + diff --git a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre index b6441e85d..052bbc2eb 100644 --- a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre +++ b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre @@ -1,7 +1,7 @@ - + diff --git a/eu.etaxonomy.taxeditor/pom.xml b/eu.etaxonomy.taxeditor/pom.xml index c69f67965..b845d6e0e 100644 --- a/eu.etaxonomy.taxeditor/pom.xml +++ b/eu.etaxonomy.taxeditor/pom.xml @@ -2,7 +2,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 4.0.0 diff --git a/pom.xml b/pom.xml index c12fa6d25..863f28c1a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ eu.etaxonomy taxeditor-parent - 4.0.0 + 4.1.0 EDIT Taxonomic Editor The Taxonomic Editor for EDIT's platform for cybertaxonomy @@ -16,12 +16,12 @@ 2007 pom - 1.6 + 1.7 UTF-8 - 4.0.0 + 4.1.0 0.22.0 - 4.0.0 + 4.1.0 snapshot 3.4.2 1.2.17 @@ -244,8 +244,8 @@ maven-compiler-plugin 2.3.2 - 1.6 - 1.6 + 1.7 + 1.7