src/site/resources/css/site.css -text
src/site/resources/images/taxeditor_transformed.png -text
src/site/site.xml -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ExportSequenceToFileHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/CDMSequenceMatrixAdapter.java -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIterator.java -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizard.java -text
+eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java -text
+eu.etaxonomy.taxeditor.molecular/src/test/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIteratorTest.java -text
# The following files will be ignored when merging another
# branch into this branch in case of merge conflict and
**/pom.xml merge=ours
**/MANIFEST.MF merge=ours
**/feature.xml merge=ours
-eu.etaxonomy.taxeditor.cdmlib/.classpath merge=ours
eu.etaxonomy.taxeditor.cdmlib/build.properties merge=ours
-eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ExportSequenceToFileHandler.java -text
-eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/CDMSequenceMatrixAdapter.java -text
-eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIterator.java -text
-eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizard.java -text
-eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java -text
-eu.etaxonomy.taxeditor.molecular/src/test/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIteratorTest.java -text
-eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product merge=ours
+eu.etaxonomy.taxeditor.printpublisher/build.properties merge=ours
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre merge=ours
+eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product merge=ours
+
+
Bundle-ManifestVersion: 2
Bundle-Name: Application
Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
Bundle-Vendor: EDIT
Bundle-Localization: OSGI-INF/l10n/plugin
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: Bulkeditor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: CDM Library Dependencies Plugin
Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Eclipse-BundleShape: dir
Export-Package: com.sun.istack.internal.tools,
com.sun.istack.internal.ws,
Bundle-ClassPath: .,
lib/apache-log4j-extras-1.2.17.jar,
lib/aspectjrt-1.9.6.jar,
- lib/cdmlib-commons-5.20.0.jar,
- lib/cdmlib-ext-5.20.0.jar,
- lib/cdmlib-io-5.20.0.jar,
- lib/cdmlib-model-5.20.0.jar,
- lib/cdmlib-persistence-5.20.0.jar,
- lib/cdmlib-cache-5.20.0.jar,
- lib/cdmlib-services-5.20.0.jar,
+ lib/cdmlib-commons-5.21.0.jar,
+ lib/cdmlib-ext-5.21.0.jar,
+ lib/cdmlib-io-5.21.0.jar,
+ lib/cdmlib-model-5.21.0.jar,
+ lib/cdmlib-persistence-5.21.0.jar,
+ lib/cdmlib-cache-5.21.0.jar,
+ lib/cdmlib-services-5.21.0.jar,
lib/commons-beanutils-1.9.4.jar,
lib/commons-codec-1.15.jar,
lib/commons-collections-3.2.2.jar,
lib/apache-log4j-extras-1.2.17.jar,\
lib/aspectjrt-1.9.6.jar,\
lib/aspectjweaver-1.9.6.jar,\
- lib/cdmlib-commons-5.20.0.jar,\
- lib/cdmlib-ext-5.20.0.jar,\
- lib/cdmlib-io-5.20.0.jar,\
- lib/cdmlib-model-5.20.0.jar,\
- lib/cdmlib-persistence-5.20.0.jar,\
- lib/cdmlib-services-5.20.0.jar,\
+ lib/cdmlib-commons-5.21.0.jar,\
+ lib/cdmlib-ext-5.21.0.jar,\
+ lib/cdmlib-io-5.21.0.jar,\
+ lib/cdmlib-model-5.21.0.jar,\
+ lib/cdmlib-persistence-5.21.0.jar,\
+ lib/cdmlib-services-5.21.0.jar,\
lib/commons-beanutils-1.9.4.jar,\
lib/commons-codec-1.15.jar,\
lib/commons-collections-3.2.2.jar,\
lib/lucene-analyzers-common-5.4.1.jar,\
lib/lucene-sandbox-5.4.1.jar,\
lib/lucene-suggest-5.4.1.jar,\
- lib/cdmlib-cache-5.20.0.jar,\
+ lib/cdmlib-cache-5.21.0.jar,\
lib/org.swtchart_0.10.0.v20160212.jar,\
lib/commons-collections4-4.4.jar,\
lib/commons-math3-3.6.1.jar,\
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>5.20.0</version>\r
+ <version>5.21.0</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
* NOTE: For updating this class to the latest hibernate version, update the serialVersionUID as
* described above, copy the new class to the old class BUT keep those 5 places marked with
* ##REMOTING-KEEP##
- *
+ *
* @author Gavin King
* @author Cherian Mathew
*/
isJTA = session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta();
-
+
if ( !isJTA ) {
// Explicitly handle the transactions only if we're not in
// a JTA environment. A lazy loading temporary session can
// both when using property paths and switching off conversations
if(session == null && remoting) {
remoteInitialize();
- } else {
+ } else {
//keep formatting below to ease update to newer hibernate version
//##REMOTING-KEEP END##
withTemporarySessionIfNeeded(
this.orphan = orphan;
}
- public void replace(CollectionPersister persister, Map copyCache) {
+ @Override
+ public void replace(CollectionPersister persister, Map copyCache) {
if ( addedValue != null ) {
addedValue = getReplacement( persister.getElementType(), addedValue, copyCache );
}
this.owner = owner;
}
-
-/** ##REMOTING-KEEP## #######################################################
-
+
+/** ##REMOTING-KEEP## #######################################################
+
ADDED PART: Below is the section of code which makes remote service calls.
Keeps this code when upgrading to newer hibernate version. Also keep
other code marked with ##REMOTING-KEEP## in the following 5 methods:
-
+
{@link #initialize(boolean)}
{@link #readSize()}
{@link #readIndexExistence(Object)}
{@link #readElementExistence(Object)}
{@link #readElementByIndex(Object)}
-
+
######################################################################### */
-
+
private static CdmApplicationRemoteConfiguration configuration;
private static boolean remoting = false;
private void remoteInitialize() {
if (getOwner() != null && !initialized) {
-
+ Object collectionType = null;
+ Field field = null;
+ Class<?> clazz = null;
try {
String role = getRole();
String fieldName = role.substring(role.lastIndexOf(".") + 1);
}
afterInitialize();
- Class<?> clazz = getClass();
+ clazz = getClass();
if (clazz != null) {
//CollectionField cf = cachedCommonService.getCollectionField(col);
//cachedCommonService.updatePersistentCollection(cf);
- Object collectionType = ProxyUtils.getCollectionType(obj, clazz);
- Field field = clazz.getDeclaredField(collectionType.toString());
+ collectionType = ProxyUtils.getCollectionType(obj, clazz);
+ field = clazz.getDeclaredField(collectionType.toString());
field.setAccessible(true);
field.set(this, obj);
ProxyUtils.setRoleValueInOwner(owner, role, obj);
}
} catch (Exception ex) {
- throw new CdmEagerLoadingException(ex);
+ String originalMessage = ex.getMessage();
+ String message = originalMessage + "clazz: " + (clazz == null? "" :clazz.getSimpleName())+ "- field: " + field + " - collectionType: " + collectionType;
+ throw new CdmEagerLoadingException(message);
}
}
}
UpdateResult result = (UpdateResult)invocationResult.getValue();
if(result.isOk()){
logger.debug("Entity from UpdateResult stored in cache with updating cached data" );
- cdmEntitySessionManager().load(result, true);
+ try {
+ cdmEntitySessionManager().load(result, true);
+ } catch (Exception e) {
+ String message = "Error when trying to add update result to session cache in TaxEditor";
+ throw new RuntimeException(message, e);
+ }
}
} else {
invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), false));
invocationResult = remoteInvocationTermCacher.termsFromCache(invocation);
if(invocationResult == null) {
invocationResult = doExecuteRequest(invocation, originalInvocation);
- remoteInvocationTermCacher.cacheTerms(invocation, invocationResult);
+ try {
+ remoteInvocationTermCacher.cacheTerms(invocation, invocationResult);
+ } catch (Exception e) {
+ String message = "Error when caching terms in TaxEditor";
+ throw new RuntimeException(message, e);
+ }
logger.debug("Term list loaded and cached");
} else {
logger.debug("Term list found in cache, not loaded");
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
-
-
- <!-- Default application context and term initializer -->
- <import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml" />
- <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
- <property name="omit" value="false" />
- </bean>
-
-
-
- <bean id="cdmEntitySessionManager" class="eu.etaxonomy.taxeditor.session.CdmEntitySessionManager" />
-
- <import resource="classpath:/eu/etaxonomy/cdm/remote.xml" />
- <import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml" />
-
- <context:component-scan base-package="eu/etaxonomy/cdm/ext" />
-
- <context:component-scan base-package="eu/etaxonomy/cdm/remote">
- <context:exclude-filter type="regex"
- expression="eu\.etaxonomy\.cdm\.remote\.config\.DataSourceConfigurer" />
- <context:exclude-filter type="regex"
- expression="eu\.etaxonomy\.cdm\.remote\.config\.LoggingConfigurer" />
- <context:exclude-filter type="regex"
- expression="eu\.etaxonomy\.cdm\.remote\.view\.PatternViewResolver" />
- <context:exclude-filter type="regex"
- expression="eu\.etaxonomy\.cdm\.remote\.vaadin\..*" />
- <context:exclude-filter type="regex"
- expression="eu\.etaxonomy\.cdm\.remote\.controller\..*Portal.*" />
- </context:component-scan>
-</beans>
<beans xmlns="http://www.springframework.org/schema/beans"\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
xmlns:tx="http://www.springframework.org/schema/tx"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">\r
\r
<!--\r
UNUSED: replaced by CdmApplicationRemoteConfiguration but CdmApplicationRemoteConfiguration should be transformed into \r
Bundle-ManifestVersion: 2
Bundle-Name: Editor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: OSGI-INF/l10n/plugin
command.label.24 = New Alternative\r
command.label.25 = Refresh\r
command.label.26 = Delete\r
-command.label.27 = New Factual Data Set\r
+command.label.27 = New Factual Dataset\r
menu.label.1 = New\r
-command.label.28 = Move Factual Data Set to other Taxon\r
+command.label.28 = Move Factual Dataset to other Taxon\r
command.label.29 = Move Fact(s) to other Taxon\r
command.label.30 = Delete\r
command.label.31 = Save\r
command.name.8 = Remove Basionym / Original Combination\r
command.name.9 = Delete All Empty Names\r
category.name.1 = -- Factual\r
-command.name.10 = Create Factual Data Set\r
-command.name.11 = New Factual Data Set\r
-command.name.13 = Move Factual Data Set to other Taxon\r
-command.name.131 = Move Factual Data Set to other Taxon and set Name in Sources if empty\r
-command.label.131 = Move Factual Data Set to other Taxon and set Name in Sources if empty\r
+command.name.10 = Create Factual Dataset\r
+command.name.11 = New Factual Dataset\r
+command.name.13 = Move Factual Dataset to other Taxon\r
+command.name.131 = Move Factual Dataset to other Taxon and set Name in Sources if empty\r
+command.label.131 = Move Factual Dataset to other Taxon and set Name in Sources if empty\r
command.name.132 = Move Fact(s) to other Taxon and set Name in Sources if empty\r
command.label.132 = Move Fact(s) to other Taxon and set Name in Sources if empty\r
command.name.12 = Move Fact(s) to other Taxon\r
handledtoolitem.label.3 = Collapse
handledtoolitem.label.4 = Expand
handledmenuitem.label.11 = Open Graph
-partdescriptor.label.3 = Descriptive Data Set Editor
-partdescriptor.tooltip.1 = Descriptive Data Set Editor
+partdescriptor.label.3 = Descriptive Dataset Editor
+partdescriptor.tooltip.1 = Descriptive Dataset Editor
partdescriptor.label.4 = Character Matrix
partdescriptor.tooltip.2 = Character Matrix
menu.label.7 = Character Matrix
handledmenuitem.label.12 = Export
-partdescriptor.label.5 = Descriptive Data Set Navigator
+partdescriptor.label.5 = Descriptive Dataset Navigator
dynamicmenucontribution.label.2 = Open in...
-handledmenuitem.label.13 = New Descriptive Data Set
-handledmenuitem.tooltip.1 = New Descriptive Data Set
-handledmenuitem.label.14 = Delete Descriptive Data Set
-handledmenuitem.tooltip.2 = Delete Descriptive Data Set
+handledmenuitem.label.13 = New Descriptive Dataset
+handledmenuitem.tooltip.1 = New Descriptive Dataset
+handledmenuitem.label.14 = Delete Descriptive Dataset
+handledmenuitem.tooltip.2 = Delete Descriptive Dataset
command.commandname.9 = Delete
command.commandname.10 = Delete Media
command.commandname.11 = Open related concept in bulk editor
command.commandname.12 = Open Graph Editor
command.commandname.13 = Open Specimen Editor
command.commandname.14 = Open Character Matrix
-command.commandname.15 = Open Descriptive Data Set Editor
+command.commandname.15 = Open Descriptive Dataset Editor
command.commandname.16 = Export Character Matrix
-command.commandname.17 = New Descriptive Data Set
-command.commandname.18 = Delete Descriptive Data Set
+command.commandname.17 = New Descriptive Dataset
+command.commandname.18 = Delete Descriptive Dataset
command.commandname.19 = Refresh
command.commandname.20 = Open specimen tree editor for gathering event
-handledmenuitem.label.15 = Descriptive Data Sets
+handledmenuitem.label.15 = Descriptive Datasets
handledmenuitem.label.16 = Character Editor
handledmenuitem.tooltip.4 = Character Editor
handledmenuitem.label.17 = Remove Taxon
command.commandname.21 = Remove taxon
-handledmenuitem.label.18 = New Factual Data Set with source
-handledmenuitem.label.19 = Create default description
-handledmenuitem.label.20 = Create literature description
+handledmenuitem.label.18 = New Factual Dataset with source
+handledmenuitem.label.19 = Default description
+handledmenuitem.label.20 = Literature description
handledmenuitem.label.21 = Invalid Designation\r
command.commandname.22 = Create Invalid Designation\r
handledmenuitem.label.22 = Invalid Designation\r
handledmenuitem.label.17 = Taxon entfernen
command.commandname.21 = Taxon entfernen
handledmenuitem.label.18 = Neues Faktendaten-Set mit Quelle
-handledmenuitem.label.19 = Standard-Beschreibung erstellen
-handledmenuitem.label.20 = Literatur-Beschreibung erstellen
+handledmenuitem.label.19 = Neue Standard-Beschreibung
+handledmenuitem.label.20 = Neue Literatur-Beschreibung
handledmenuitem.label.21 = Invalid Designation
command.commandname.22 = Erstelle Invalid Designation
handledmenuitem.label.22 = Invalid Designation
handledmenuitem.label.27 = Löschen
handledmenuitem.label.28 = Beschreibung löschen
partdescriptor.label.6 = Distribution Editor
-command.commandname.24 = Beschreibung löschen
-command.commandname.25 = Beleg(e) zufügen
+command.commandname.24 = Löschen
+command.commandname.25 = Beleg(e) hinzufügen
command.commandname.26 = Aggregieren
command.commandname.27 = Erzeuge polytomen Schlüssel
\ No newline at end of file
<children xsi:type="menu:HandledMenuItem" xmi:id="_bu3dIIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.delete" label="%command.label.15" command="_CoVcYIvQEee7R4eqeQiXZg"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_dVXg4Il5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.deleteEmptyNames" label="%command.label.16" command="_L4vQwIvQEee7R4eqeQiXZg"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_e7Jy8Il5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.14"/>
- <children xsi:type="menu:HandledMenuItem" xmi:id="_VYMVkL9KEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.swapSynonymWithAccpeted" label="%command.label.171" command="_tuB4AL9KEemCian_vXpNsA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_fkhgEIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.swapSynonymWithAccpetedSetNameInSource" label="%command.label.17" command="_UFDx8IvQEee7R4eqeQiXZg"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="_VYMVkL9KEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.swapSynonymWithAccpeted" label="%command.label.171" command="_tuB4AL9KEemCian_vXpNsA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_hdfz4Il5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.setAsBasionym" label="%command.label.57" command="_b2nCsIvQEee7R4eqeQiXZg"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_iw4HUIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menuItem.moveSynonym" label="%command.label.56" command="_jNvBQIvQEee7R4eqeQiXZg"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_kS2QYIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.15"/>
<menus xsi:type="menu:PopupMenu" xmi:id="__10yYLKREeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix">
<children xsi:type="menu:HandledMenuItem" xmi:id="_AyHbgLKSEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.createdefaultdescription" label="%handledmenuitem.label.19" command="_ZHC3oLKVEeikjKoOnLFm2w"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_DYlHcLKSEeikjKoOnLFm2w" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.createliteraturedescription" label="%handledmenuitem.label.20" command="_fkPkkLKVEeikjKoOnLFm2w"/>
- <children xsi:type="menu:HandledMenuItem" xmi:id="__SlnwI97EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.deletedescription" label="%handledmenuitem.label.28" command="_MYd44I98EeqyUKRuXQ8miw"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_ARo78KSvEeq8Gc-K2nsNRg" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.adddescription" label="%command.commandname.25" command="_zCGQ8JN1EeqyUKRuXQ8miw"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_MhHQYLIfEeqvn5lIFwyIRw" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.29"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_vBrWQKY-Eeq8Gc-K2nsNRg" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.aggregate" label="%command.commandname.26" command="_K2C_oKZAEeq8Gc-K2nsNRg"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_wkVAMKotEeqBXdGXVmg_xA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.create_key" label="%command.commandname.27" command="_vWxB4KoiEeqBXdGXVmg_xA"/>
<children xsi:type="menu:MenuSeparator" xmi:id="_Pu6CELIfEeqvn5lIFwyIRw" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.30"/>
+ <children xsi:type="menu:HandledMenuItem" xmi:id="__SlnwI97EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.deletedescription" label="%handledmenuitem.label.27" command="_MYd44I98EeqyUKRuXQ8miw"/>
</menus>
</elements>
<elements xsi:type="basic:PartDescriptor" xmi:id="_XcQMEN8mEee9zP45RW4C3A" elementId="eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetNavigator" label="%partdescriptor.label.5" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetNavigator">
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
import org.eclipse.nebula.widgets.nattable.selection.event.CellSelectionEvent;
import org.eclipse.nebula.widgets.nattable.selection.event.RowSelectionEvent;
+import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
/**
* @author pplitzner
return;
}
}
+ }else if (columnPosition == 0 ){
+ Collection<ILayerCell> selectedCells = cellSelectionEvent.getSelectionLayer().getSelectedCells();
+ if(selectedCells.size()==1){
+ ILayerCell cell = selectedCells.iterator().next();
+ int rowIndex = cell.getRowIndex();
+
+ Object dataValue = cell.getDataValue();
+ if(dataValue!=null && dataValue instanceof DescriptionBaseDto){
+ DescriptionBase descBase = ((DescriptionBaseDto)dataValue).getDescription();
+ part.getSelectionService().setSelection(new StructuredSelection(descBase));
+ return;
+ }
+ }
}
}
else if(event instanceof RowSelectionEvent){
if(fullySelectedRowPositions.length==1){
Object rowObject = part.getMatrix().getBodyDataProvider().getRowObject(fullySelectedRowPositions[0]);
if(rowObject instanceof RowWrapperDTO){
- part.getSelectionService().setSelection(new StructuredSelection(((RowWrapperDTO) rowObject).getDescription()));
+ part.getSelectionService().setSelection(new StructuredSelection(((RowWrapperDTO) rowObject).getDescription().getDescription()));
return;
}
}
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
private MouseEventMatcher mouseEventMatcher = null;
+ private Set<DescriptionBase> descriptionsToSave = new HashSet<>();
+
public CharacterMatrix(Composite parent, CharacterMatrixPart part) {
super(parent, SWT.NONE);
this.part = part;
btnToggleTree.setEnabled(!isTree);
btnCollapseAll.setEnabled(isTree);
btnExpandAll.setEnabled(isTree);
+
}
public boolean isTreeView() {
return categoricalFeatureToStateMap.get(feature);
}
+ public Set<DescriptionBase> getDescriptionsToSave() {
+ return descriptionsToSave;
+ }
+
+ public void addDescriptionToSave(DescriptionBase descriptionToSave) {
+ this.descriptionsToSave.add(descriptionToSave);
+ }
+
public Map<Integer, Feature> getIndexToFeatureMap() {
return indexToFeatureMap;
}
// job.schedule();
}
+ @Inject
+ @Optional
+ private void updateView(@UIEventTopic(WorkbenchEventConstants.ADD_TO_MERGE_ROWS) UUID uuid) {
+
+ }
+
+
}
import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.CellPainterDecorator;
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
+import org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum;
import org.eclipse.nebula.widgets.nattable.style.Style;
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
DisplayMode.NORMAL,
CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
+ Style style = new Style();
+
+ style.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, HorizontalAlignmentEnum.LEFT);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ style,
+ DisplayMode.NORMAL,
+ CharacterMatrix.IDENTIFIER_COLUMN);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ style,
+ DisplayMode.NORMAL,
+ CharacterMatrix.COLLECTOR_COLUMN);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ style,
+ DisplayMode.NORMAL,
+ CharacterMatrix.COUNTRY_COLUMN);
+ configRegistry.registerConfigAttribute(
+ CellConfigAttributes.CELL_STYLE,
+ style,
+ DisplayMode.NORMAL,
+ CharacterMatrix.TAXON_COLUMN);
+
+
/*
* cell painter for description icons
*/
*/
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
* @since Nov 26, 2017
*/
public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled, IDirtyMarkable,
- ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasSupplementalData,
+ ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasSupplementalData,
IPartContentHasDetails {
private static final List<String> WS_PROPERTY_PATH = Arrays.asList(new String[] {
matrix.getDescriptionsToDelete().clear();
}
-
+ CdmStore.getService(IDescriptionService.class).merge(new ArrayList<>(matrix.getDescriptionsToSave()), true);
+ matrix.getDescriptionsToSave().clear();
UpdateResult results = CdmStore.getService(IDescriptionService.class).mergeDescriptions(descriptionsToMerge, matrix.getDescriptiveDataSet().getUuid());
matrix.getRowsToMerge().clear();
conversation.commit();
public void changed(Object element) {
setDirty();
matrix.getNatTable().refresh();
+ if (element instanceof DescriptionBase){
+ if (!matrix.getRowsToMerge().containsKey(((DescriptionBase)element).getUuid())){
+ matrix.addDescriptionToSave((DescriptionBase)element);
+ }
+ }
}
@Override
}
}
}
+// for (TaxonName name:toSaveNewNames){
+// name.get
+// }
if (!toSaveNewNames.isEmpty()){
CdmStore.getService(INameService.class).merge(toSaveNewNames, true);
toSaveConcepts.clear();
- CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+
for(AbstractPostOperation<?> entry:operations){
IStatus status = Status.CANCEL_STATUS;
}
operations.clear();
-
+ CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
}
private void delete(TaxonBase key, TaxonBaseDeletionConfigurator value) {
* 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.handler.create;
import javax.inject.Named;
import eu.etaxonomy.taxeditor.newWizard.NewNonViralNameWizard;
/**
- *
* @author pplitzner
* @date 10.10.2017
- *
*/
public class NewNameHandler {
wizard.init(null, null);
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.open();
-
}
-}
+}
\ No newline at end of file
+/**
+* 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.handler.defaultHandler;
+
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-
-public class DefaultOpenSpecimenEditorForTypeSpecimenHandler extends
- DefaultOpenHandlerBaseE4<SpecimenTypeDesignation> {
-
-// @Override
-// protected SpecimenTypeDesignation getEntity(UUID uuid) {
-// return CdmStore.getCommonService().find(SpecimenTypeDesignation.class, uuid);
-// }
+public class DefaultOpenSpecimenEditorForTypeSpecimenHandler
+ extends DefaultOpenHandlerBaseE4<SpecimenTypeDesignation> {
@Override
protected void open(SpecimenTypeDesignation entity, Shell shell, EPartService partService) {
protected String getPartId() {
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW;
}
-
-}
+}
\ No newline at end of file
+/**
+* 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.handler.defaultHandler;
+
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
import eu.etaxonomy.taxeditor.editor.AppModelId;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
-
-public class DefaultOpenTaxonEditorForTaxonBaseHandler extends DefaultOpenHandlerBaseE4<TaxonBase> {
-
-// @Override
-// protected TaxonBase getEntity(UUID uuid) {
-// return CdmStore.getService(ITaxonService.class).load(uuid);
-// }
+public class DefaultOpenTaxonEditorForTaxonBaseHandler
+ extends DefaultOpenHandlerBaseE4<Object> {
@Override
- protected void open(TaxonBase entity, Shell shell, EPartService partService) {
- EditorUtil.openTaxonBaseE4(entity.getUuid(), modelService, partService, application);
+ protected void open(Object entity, Shell shell, EPartService partService) throws Exception {
+ if (entity instanceof TaxonBase){
+ EditorUtil.openTaxonBaseE4(((TaxonBase<?>)entity).getUuid(), modelService, partService, application);
+ }else if (entity instanceof UuidAndTitleCache){
+ EditorUtil.openTaxonBaseE4(((UuidAndTitleCache<?>)entity).getUuid(), modelService, partService, application);
+ }else{
+ throw new Exception("Only objects of type taxonbase can be handled.");
+ }
}
- /**
- * {@inheritDoc}
- */
@Override
protected boolean canExecute(Object entity) {
- return true;
+ return (entity instanceof TaxonBase) || (entity instanceof UuidAndTitleCache);
}
@Override
protected String getPartId() {
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4;
}
-
-}
+}
\ No newline at end of file
+/**
+* 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.handler.defaultHandler;
+
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
-
-public class DefaultOpenTaxonEditorForTaxonNodeHandler extends DefaultOpenHandlerBaseE4<TaxonNodeDto> {
-
-// @Override
-// protected TaxonNode getEntity(UUID uuid) {
-// return CdmStore.getService(ITaxonNodeService.class).load(uuid);
-// }
+public class DefaultOpenTaxonEditorForTaxonNodeHandler
+ extends DefaultOpenHandlerBaseE4<TaxonNodeDto> {
@Override
protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) {
}
}
- /**
- * {@inheritDoc}
- */
@Override
protected boolean canExecute(Object selection) {
if (((IStructuredSelection)selection).getFirstElement() instanceof TaxonNodeDto){
protected String getPartId() {
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4;
}
-
-}
+}
\ No newline at end of file
public static String ChangeSynonymToAcceptedTaxonOperation_NOT_IMPLEMENTED;
public static String ChangeSynonymToAcceptedTaxonOperation_DifferentSec;
public static String ChangeSynonymToAcceptedTaxonOperation_DifferentSec_Message;
+ public static String ChangeSynonymToAcceptedHandler_Different_Publish_Flag;
+ public static String SwapSynonymToAcceptedHandler_Different_Publish_Flag;
public static String CharacterEditor_CANNOT_PERFORM_MESSAGE;
public static String CharacterEditor_CANNOT_PERFORM_TITLE;
public static String CharacterEditor_CHARACTERS;
public static String DeleteHandler_INVALID_SELECTION;
public static String DeleteHandler_SKIP;
public static String DeleteMediaHandler_CONFIRM;
- public static String DeleteMediaHandler_CONFIRM_MESSAGE;
+ public static String DeleteMediaHandler_CONFIRM_MESSAGE_DESCRIPTION;
+ public static String DeleteMediaHandler_CONFIRM_MESSAGE_MEDIA;
public static String DeleteMediaHandler_DELETE;
public static String DeleteMediaHandler_SKIP;
public static String DeleteNodeHandler_CANCEL;
public static String MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION;
public static String MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION_MESSAGE;
public static String MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON;
+ public static String MoveSynonymToAnotherAcceptedTaxonHandler_Different_Publish_Flag;
public static String MultiPageTaxonEditor_INVALID_INPUT;
public static String MultiPageTaxonEditor_NEW_TAXON;
public static String MultiPageTaxonEditor_NO_NAME_SPECIFIED;
public static String SwapSynonymAndAcceptedHandler_COULD_NOT_OPEN;
public static String SwapSynonymAndAcceptedOperation_NOT_IMPLEMENTED;
public static String SwapSynonymAndAcceptedOperation_SWAP_SYN_ACC_TAXON;
+ public static String SwapSynonymAndAcceptedOperation_DIFFERENT_PUBLISH;
public static String SynonymContainer_SYNONYM_NULL_NAME;
public static String TaxonEditorInput_INCORRECT_STATE;
public static String TaxonEditorInput_NEW_TAXON;
public static String DeleteDescriptiveDatasetHandler_Exception_Message;
public static String CharacterMatrix_ONLY_REMOVE;
public static String CharacterMatrix_DELETE_DESCRIPTION;
+ public static String ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message;
+ public static String ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title;
+ public static String ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Parent;
+ public static String ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Select;
+ public static String ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Keep;
+ public static String MoveSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message;
static {
CategoricalChartTooltip_TOOLTIP_NOT_AVAILABLE=Tooltip not available. First aggregate the data.
CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR=Create new field unit for %s
-CreateDescriptiveDataSetHandler_NEW_DESCRIPTIVE_DATA_SET=New descriptive data set
+CreateDescriptiveDataSetHandler_NEW_DESCRIPTIVE_DATA_SET=New descriptive dataset
CreateDescriptiveDataSetHandler_NEW_DATA_SET_DIALOG_TITLE=Enter name
SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Reuse for other Sequence
TaxonNameEditor_SAVING_NAMES=Saving names
TaxonNameEditor_THERE_SHOULD_ALWAYS_BE=There should always be a selected object.
TaxonNodeDropAdapter_CLASSIFICATIONS_NO_MATCH=Classifications do not match
-TaxonNodeDropAdapter_CLASSIFICATIONS_NO_MATCH_MESSAGE=The taxon node you are trying to add belongs to another classification than the node(s) belonging to the descriptive data set.
+TaxonNodeDropAdapter_CLASSIFICATIONS_NO_MATCH_MESSAGE=The taxon node you are trying to add belongs to another classification than the node(s) belonging to the descriptive dataset.
ValidationDaemon_RUNNING_DAEMON=Running validation daemon
ValidationDaemon_VALIDATION_EXCEPTION=Validation module terminated unexpectedly:
ValidationDaemon_VALIDATION_STOPPED=Validation module stopped
MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION=No selection
MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION_MESSAGE=No synonym selected
MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON=Select new accepted taxon
+MoveSynonymToAnotherAcceptedTaxonHandler_Different_Publish_Flag=The new accepted taxon and the synonym have different pubish flags. Maybe one of them should be adapted.
SwapSynonymAndAcceptedHandler_COULD_NOT_OPEN=Could not open editor for taxon
+SwapSynonymAndAcceptedOperation_DIFFERENT_PUBLISH=The accepted taxon and the synonym have different pubish flags. Maybe one of them should be adapted.
ChangeConceptRelationshipTypeOperation_NOT_IMPLEMENTED=Not implemented yet. See developer documentation for details
ChangeConceptToSynonymOperation_MULTI_REPS=Multiple relations between taxa
ChangeConceptToSynonymOperation_MULTI_REPS_MESSAGE=There are multiple relations between the accepted and the related taxon. This case is not handled by the software yet.
CharacterMatrix_ONLY_REMOVE=Only remove from descriptive dataset
CharacterMatrix_DELETE_DESCRIPTION=Do you really want to delete the description
CharacterMatrixBottomToolbar_AGGREGATE=Aggregate
-CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE=The aggregated description will be stored at the common parent taxon of this data set:\n%s\n\nDo you want to use this taxon?
+CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE=The aggregated description will be stored at the common parent taxon of this dataset:\n%s\n\nDo you want to use this taxon?
CharacterMatrixBottomToolbar_AGGREGATION_TITLE=Choose location for the aggregated description
CharacterMatrixBottomToolbar_CANCEL=Cancel
CharacterMatrixBottomToolbar_CHOOSE_TAXON=Choose taxon
CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE=Errors during row creation
CharacterMatrixBottomToolbar_YES=Yes
CharacterMatrixPart_COULD_NOT_OPEN=Editor could not be opened
-CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=The descriptive data set has no character tree selected or the tree contains elements that are not characters.
+CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE=The descriptive dataset has no character tree selected or the tree contains elements that are not characters.
CharacterMatrixPart_LOADING_MATRIX=Loading matrix...
CharacterMatrixPart_LOADING_MATRIX_FAILED=Loading failed
SwapSynonymAndAcceptedOperation_NOT_IMPLEMENTED=Not yet implemented
DeleteDescriptionElementOperation_DESC_NOT_FOUND=Couldn't find element's description!
DeleteDescriptiveDataSetHandler_DELETE_FAILED_MESSAGE=Deletion failed.
DeleteDescriptiveDataSetHandler_DELETE_FAILED_TITLE=Deletion failed
-DeleteDescriptiveDataSetHandler_DELETE_MESSAGE=Do you really want to delete the descriptive data set?
+DeleteDescriptiveDataSetHandler_DELETE_MESSAGE=Do you really want to delete the descriptive dataset?
DeleteDescriptiveDataSetHandler_DELETE_TITLE=Confirm delete
DeleteHandler_CONFIRM_DELETION=Confirm Deletion
DeleteHandler_CONFIRM_DELETION_MESSAGE=Do you really want to delete the media?
DeleteHandler_INVALID_SELECTION=Selection is not valid for this delete handler
DeleteHandler_SKIP=Skip
DeleteMediaHandler_CONFIRM=Confirm Deletion
-DeleteMediaHandler_CONFIRM_MESSAGE=Do you really want to delete the media?
+DeleteMediaHandler_CONFIRM_MESSAGE_DESCRIPTION=The media gallery contains media. Do you want to delete the media?
+DeleteMediaHandler_CONFIRM_MESSAGE_MEDIA=Do you really want to delete the media?
DeleteMediaHandler_DELETE=Delete
-DeleteMediaHandler_SKIP=Skip
+DeleteMediaHandler_SKIP=Cancel
OpenDerivativeEditorForDescriptionElement_NO_SPECIMENS=No specimens found
OpenDerivativeEditorForDescriptionElement_NO_SPECIMENS_MESSAGE=No specimens found for the selected object. (Maybe there are unsaved changes)
OpenDerivativeEditorForTaxonNode_COULD_NOT_OPEN=Specimen tree editor could not be opened
FactualDataView_Lable=Factual Data
NameFactsDataView_Lable=Name Facts
DeleteDescriptiveDatasetHandler_Exception_Message=Descriptive Dataset could not be deleted.
-DeleteDescriptiveDatasetHandler_Warning_Message=Deletion was successful but with warnings.
\ No newline at end of file
+DeleteDescriptiveDatasetHandler_Warning_Message=Deletion was successful but with warnings.
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title=Select secundum reference
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message=The secundum reference of the selected parent taxon is different to the secundum of the synonym. Please select which secundum should be used for the accepted taxon.
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Parent=Parent secundum
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Select=Select new
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Keep=Keep secundum
+ChangeSynonymToAcceptedHandler_Different_Publish_Flag=The selected parent taxon and the new taxon have different publish flags. Maybe one of them should be adapted.
+SwapSynonymToAcceptedHandler_Different_Publish_Flag=The selected parent taxon, the new taxon and the new synonym have different publish flags. Maybe one of them should be adapted.
+MoveSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message= Secundum reference of synonym (or synonyms of the homotypic group) and new accepted taxon are different. Please select the reference used as secundum.
\ No newline at end of file
MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION=Keine Auswahl
MoveSynonymToAnotherAcceptedTaxonHandler_NO_SELECTION_MESSAGE=Kein Synonym ausgewählt
MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON=Wähle neues akzeptiertes Taxon
+MoveSynonymToAnotherAcceptedTaxonHandler_Different_Publish_Flag=Das neue akzeptierte Taxon und das Synonym haben unterschiedliche Publikationsstatus. Eventuell sollten sie angepasst werden.
SwapSynonymAndAcceptedHandler_COULD_NOT_OPEN=Konnte Editor für Taxon nicht öffnen
+SwapSynonymAndAcceptedOperation_DIFFERENT_PUBLISH=Das akzeptierte Taxon und das Synonym haben unterschiedliche Publikationsstatus. Eventuell sollten sie angepasst werden.
ChangeConceptRelationshipTypeOperation_NOT_IMPLEMENTED=Noch nicht implementiert. Für Details bitte in die Entwickler-Dokumentation schauen
ChangeConceptToSynonymOperation_MULTI_REPS=Mehrere Verknüpfungen zwischen Taxa
ChangeConceptToSynonymOperation_MULTI_REPS_MESSAGE=Es gibt mehrere Verknüpfungen zwischen dem akzeptierten und dem verknüpften Taxon. Dieser Fall wird noch nicht von der Software unterstützt.
CharacterMatrix_SHOW_HIERARCHY=Baumansicht
CharacterMatrix_TAXON=Unit
CharacterMatrix_VIEW_CONFIG=Ansicht konfigurieren
-CharacterMatrix_ONLY_REMOVE=Nur aus Descriptive Data Set entfernen
+CharacterMatrix_ONLY_REMOVE=Nur aus Descriptive Dataset entfernen
CharacterMatrix_DELETE_DESCRIPTION=Wollen Sie die Beschreibung wirklich löschen?
CharacterMatrixBottomToolbar_AGGREGATE=Aggregation
CharacterMatrixBottomToolbar_AGGREGATION_MESSAGE=Die aggregierte Beschreibung wird an das gemeinsame, nächst-höhere Taxon dieses Datasets gehangen:\n%s\n\nSoll dieses Taxon verwenden werden?
DeleteHandler_INVALID_SELECTION=Auswahl ungültig für den DeleteHandler
DeleteHandler_SKIP=Ãœberspringen
DeleteMediaHandler_CONFIRM=Löschen bestätigen
-DeleteMediaHandler_CONFIRM_MESSAGE=Wollen sie wirklich den Mediendatensatz löschen?
+DeleteMediaHandler_CONFIRM_MESSAGE_DESCRIPTION=Die Medien Galerie enthält Mediendaten. Wollen sie diese löschen?
+DeleteMediaHandler_CONFIRM_MESSAGE_MEDIA=Wollen sie wirklich den Mediendatensatz löschen?
DeleteMediaHandler_DELETE=Löschen
-DeleteMediaHandler_SKIP=Ãœberspringen
+DeleteMediaHandler_SKIP=Abbrechen
OpenDerivativeEditorForDescriptionElement_NO_SPECIMENS=Keine Specimens gefunden
OpenDerivativeEditorForDescriptionElement_NO_SPECIMENS_MESSAGE=Keine Specimens für die Auswahl. (Gibt es vielleicht noch ungespeicherte Änderungen?)
OpenDerivativeEditorForTaxonNode_COULD_NOT_OPEN=Specimen-Baum-Editor konnte nicht geöffnet werden
FactualDataView_Lable=Faktendaten
NameFactsDataView_Lable=Namensfaktendaten
DeleteDescriptiveDatasetHandler_Exception_Message=Das Descriptive Dataset konnte nicht gelöscht werden.
-DeleteDescriptiveDatasetHandler_Warning_Message=Das Löschen war erfolgreich, es gibt aber Warnungen.
\ No newline at end of file
+DeleteDescriptiveDatasetHandler_Warning_Message=Das Löschen war erfolgreich, es gibt aber Warnungen.
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message=Die Secundum Referenzen des gewählten Elterntaxons und des Synonyms unterscheiden sich. Bitte wählen Sie welche Secundum Referenz für das neue akzeptierte Taxon verwendet werden soll
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title=Auswahl der Secundum Referenz
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Parent=Eltern Secundum
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Select=Neue auswählen
+ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Keep=Secundum beibehalten
+ChangeSynonymToAcceptedHandler_Different_Publish_Flag=Das gewählte Elterntaxon und das neue Taxon haben unterschiedliche Publikationsstatus. Eventuell sollten sie angepasst werden.
+SwapSynonymToAcceptedHandler_Different_Publish_Flag=Das gewählte Elterntaxon, das neue Taxon und das Synonym haben unterschiedliche Publikationsstatus. Eventuell sollten sie angepasst werden.
+MoveSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message=Die Secundum Referenz des Synonyms oder der Synonyme der homotypischen Gruppe und des neuen akzeptierten Taxons unterscheiden sich, bitte wählen Sie, welche Referenz verwendet werden soll.
\ No newline at end of file
conversation.commit(true);
dirty.setDirty(false);
- EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode()));
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode().getParent()));
EventUtility.postEvent(WorkbenchEventConstants.SAVE_TAXON, true);
// Stop the progress monitor.
monitor.done();
package eu.etaxonomy.taxeditor.editor.name.e4.handler;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
+import java.util.UUID;
import javax.inject.Named;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
/**
}
Synonym synonym = (Synonym) selection.getFirstElement();
+ Reference synSecRef = synonym.getSec();
// Force user to save taxon - not really necessary though, is it?
if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
TaxonNode newParentNode = TaxonNodeSelectionDialog.select(shell,// editor.getConversationHolder(),
Messages.ChangeSynonymToAcceptedTaxonHandler_SELECT_PARENT, null, null, input.getTaxonNode().getClassification().getUuid(), true);
-
+ Reference parentSecRef = newParentNode.getTaxon() != null? newParentNode.getTaxon().getSec(): null;
if(newParentNode != null){
// TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon
// apply confirmation dialog
HomotypicalGroup group = synonym.getHomotypicGroup();
- Set<TaxonName> namesInGroup = group.getTypifiedNames();
+ List<Synonym> homotypicSynonyms = taxon.getSynonymsInGroup(synonym.getHomotypicGroup());
+ Set<Reference> secRefs = new HashSet<>();
+ boolean nullExist = false;
+ for (Synonym synInHomtypicGroup: homotypicSynonyms){
+ if (synInHomtypicGroup.getSec() == null && synonym.getSec() != null){
+ nullExist = true;
+ }
+ secRefs.add(synInHomtypicGroup.getSec());
+ }
+
// FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node
+
+ //compare parentSec and synSec and ask for handling.
+ SecReferenceHandlingEnum secHandling = PreferencesUtil.getSecReferenceHandlingPreference();
+ UUID newSecUuid = null;
+ if (((synSecRef != parentSecRef || secRefs.size()>1) && secHandling.equals(SecReferenceHandlingEnum.KeepWhenSame) )|| secHandling.equals(SecReferenceHandlingEnum.WarningSelect)){
+
+ if ((parentSecRef != synSecRef && secHandling.equals(SecReferenceHandlingEnum.KeepWhenSame) )|| secHandling.equals(SecReferenceHandlingEnum.WarningSelect)){
+ int result = MessagingUtils.confirmDialog(Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title, Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message,
+ new String[]{Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Keep, Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Parent, Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Select});
+ if (result == 2){
+ Reference sec = ReferenceSelectionDialog.select(shell, null);
+ newSecUuid = sec != null? sec.getUuid(): null;
+ }else if (result == 1){
+ newSecUuid = parentSecRef != null? parentSecRef.getUuid(): null;
+ }else if (result == 0){
+ newSecUuid = null;
+ secHandling = SecReferenceHandlingEnum.KeepAlways;
+ }else{
+ return ;
+ }
+
+ }
+
+ }
+ if (synonym.isPublish() != newParentNode.getTaxon().isPublish()){
+ MessagingUtils.warningDialog("Publish flag",this, Messages.ChangeSynonymToAcceptedHandler_Different_Publish_Flag);
+ }
+
ChangeSynonymToAcceptedTaxonOperation operation = new ChangeSynonymToAcceptedTaxonOperation(Messages.ChangeSynonymToAcceptedTaxonHandler_CHANGE_SYN_TO_ACC_TAXON, EditorUtil.getUndoContext(),
- taxon, newParentNode, synonym, namesInGroup, this, editor, editor.getEditorInput()); //$NON-NLS-1$
+ taxon, newParentNode, synonym,
+ newSecUuid, secHandling,
+ this, editor, editor.getEditorInput()); //$NON-NLS-1$
AbstractUtility.executeOperation(operation, sync);
}
editor.save(AbstractUtility.getMonitor());
- if (objectAffectedByOperation instanceof TaxonNode) {
- // Open new unsaved editor with existing taxon's parent as temporary parent
+ if (objectAffectedByOperation instanceof TaxonNode) {
TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
-
- EditorUtil.openTaxonNodeE4(newNode.getUuid(), modelService, partService, application);
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(newNode.getParent()));
}
return true;
}
}
return canExecute;
}
-}
+}
\ No newline at end of file
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
public class MoveSynonymToAnotherAcceptedTaxonHandlerE4 implements IPostOperationEnabled{
excludeTaxa.add(oldParent.getUuid());
- newParentNode = TaxonNodeSelectionDialog.select(shell, //editor.getConversationHolder(),
- Messages.MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON, excludeTaxa, input.getTaxonNode(), input.getTaxonNode().getClassification().getUuid());
+ newParentNode = TaxonNodeSelectionDialog.select(shell, Messages.MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON, excludeTaxa, input.getTaxonNode(), input.getTaxonNode().getClassification().getUuid());
+ SecReferenceHandlingEnum secHandling = PreferencesUtil.getSecReferenceHandlingPreference();
+ UUID newSecUuid = null;
+ Reference synSecRef = synonym.getSec();
+ Reference parentSecRef = newParentNode.getTaxon() != null? newParentNode.getTaxon().getSec():null;
+ if ((synSecRef != parentSecRef && secHandling.equals(SecReferenceHandlingEnum.KeepWhenSame) )|| secHandling.equals(SecReferenceHandlingEnum.WarningSelect)){
+
+ if ((parentSecRef != synSecRef && secHandling.equals(SecReferenceHandlingEnum.KeepWhenSame) )|| secHandling.equals(SecReferenceHandlingEnum.WarningSelect)){
+ int result = MessagingUtils.confirmDialog(Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title, Messages.MoveSynonymToAcceptedHandler_Select_Sec_Reference_Handling_message,
+ new String[]{Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Keep, Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Parent, Messages.ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Select});
+ if (result == 2){
+ Reference sec = ReferenceSelectionDialog.select(shell, null);
+ newSecUuid = sec != null? sec.getUuid(): null;
+ }else if (result == 1){
+ newSecUuid = parentSecRef != null? parentSecRef.getUuid(): null;
+ }else if (result == 0){
+ newSecUuid = synSecRef != null? synSecRef.getUuid(): null;
+ }else{
+ return ;
+ }
+
+ }
+
+ }
+ boolean homotypicGroupPublish = true;
+// for (synonym.getName().getHomotypicalGroup().getTypifiedNames())
+ if (synonym.isPublish() != newParentNode.getTaxon().isPublish()){
+ MessagingUtils.warningDialog("Publish flag", this,Messages.ChangeSynonymToAcceptedHandler_Different_Publish_Flag);
+ }
if(newParentNode!=null){
MoveSynonymToAnotherAcceptedTaxonOperationE4 operation = new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.MoveSynonymToAnotherAcceptedTaxonHandler_CHANGE_ACC_TAXON, EditorUtil.getUndoContext(),
synonym.getUuid(), newParentNode.getTaxon(), this, editor);
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
protected MPart activePart;
protected MApplication application;
protected EModelService modelService;
+ protected boolean isSetNameInSource = false;
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
return;
}
+ TaxonNode parentNode = editor.getTaxonNode()!= null? editor.getTaxonNode().getParent(): null;
+ Boolean isParentPublish = null;
+ if (parentNode != null){
+ if (parentNode.getTaxon() != null){
+ isParentPublish = parentNode.getTaxon().isPublish();
+ }
+ }
+ if (synonym.isPublish() != editor.getTaxon().isPublish() || (isParentPublish != null && (isParentPublish.booleanValue() != synonym.isPublish() || isParentPublish.booleanValue() != synonym.isPublish()))){
+ MessagingUtils.warningDialog("Publish flag", this, Messages.SwapSynonymToAcceptedHandler_Different_Publish_Flag);
+ }
SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(menuItem.getLocalizedLabel(),
- editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput(), false);
+ editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput(), isSetNameInSource);
AbstractUtility.executeOperation(operation, sync);
+
}
@CanExecute
public void run() {
try {
TaxonNode node;
+
if (!taxon.getTaxonNodes().isEmpty()) {
node = taxon.getTaxonNodes().iterator().next();
} else {
}
if (node != null){
EditorUtil.openTaxonNodeE4((node).getUuid(), modelService, partService, application);
+ for (TaxonNode nodetoUpdate: taxon.getTaxonNodes()){
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(nodetoUpdate.getParent()));
+ }
}
} catch (Exception e) {
MessagingUtils.warningDialog(Messages.SwapSynonymAndAcceptedHandler_COULD_NOT_OPEN, this,
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
-import eu.etaxonomy.cdm.model.taxon.Synonym;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
/**
EModelService modelService, MApplication application,
UISynchronize sync) {
- this.activePart = activePart;
- this.modelService = modelService;
- this.application = application;
- this.partService = partService;
-
- editor = (TaxonNameEditorE4) activePart.getObject();
-
- Synonym synonym = (Synonym) selection.getFirstElement();
-
- // Force user to save taxon - not really necessary though, is it?
- if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
- return;
- }
-
- SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(menuItem.getLocalizedLabel(),
- editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput(), true);
-
- AbstractUtility.executeOperation(operation, sync);
+ this.isSetNameInSource = true;
+
+ super.execute(activePart, selection, shell, menuItem, partService, modelService, application, sync);
+
+// this.activePart = activePart;
+// this.modelService = modelService;
+// this.application = application;
+// this.partService = partService;
+//
+// editor = (TaxonNameEditorE4) activePart.getObject();
+//
+// Synonym synonym = (Synonym) selection.getFirstElement();
+//
+// // Force user to save taxon - not really necessary though, is it?
+// if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
+// return;
+// }
+//
+// SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(menuItem.getLocalizedLabel(),
+// editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput(), true);
+//
+// AbstractUtility.executeOperation(operation, sync);
}
package eu.etaxonomy.taxeditor.editor.name.operation;
-import java.util.Set;
+import java.util.UUID;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
-import eu.etaxonomy.cdm.model.name.TaxonName;
-import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
private final ITaxonTreeNode parentNode;
private TaxonNode newNode;
- private Reference newSecRef;
+ private UUID newSecRefUuid;
private SecReferenceHandlingEnum secHandling;
- //private final Set<TaxonName> namesInHomotypicGroup;
/**
* <p>Constructor for ChangeSynonymToAcceptedTaxonOperation.</p>
Taxon taxon,
ITaxonTreeNode parentNode,
Synonym synonym,
- Set<TaxonName> namesInHomotypicalGroup,
-// Reference newSec,
-// SecReferenceHandlingEnum secHandling,
+ UUID newSecUuid,
+ SecReferenceHandlingEnum secHandling,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled,
ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
this.element = taxon;
this.parentNode = parentNode;
this.synonym = synonym;
-// this.newSecRef = newSec;
-// this.secHandling = secHandling;
- //this.namesInHomotypicGroup = namesInHomotypicalGroup;
+ this.newSecRefUuid = newSecUuid;
+ this.secHandling = secHandling;
}
@Override
result = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
element.getUuid(),
parentNode.getUuid(),
- null, null, SecReferenceHandlingEnum.KeepAlways,
+ newSecRefUuid, null, secHandling,
true);
if (result.isAbort()){
return postExecute(null);
}
newNode = (TaxonNode) result.getCdmEntity();
- if (!newNode.getTaxon().getSec().equals(newNode.getParent().getTaxon().getSec())){
- MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonOperation_DifferentSec, getClass(), Messages.ChangeSynonymToAcceptedTaxonOperation_DifferentSec_Message);
-
- }
} catch (HomotypicalGroupChangeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
monitor.worked(20);
- //newTaxon = (Taxon) CdmStore.getService(ITaxonService.class).merge(newTaxon);
- //element.removeSynonym(synonym);
-
-
- /*if(namesInHomotypicGroup != null){
- Taxon taxon = newNode.getTaxon();
- for (TaxonNameBase synonymName : namesInHomotypicGroup){
- taxon.addHomotypicSynonymName(synonymName, null, null);
-
- }
- }*/
- //newNode = CdmStore.getService(ITaxonNodeService.class).merge(newNode);
-
- monitor.worked(40);
-
return postExecute(newNode);
}
/**
* @author pplitzner
* @since Jun 6, 2018
- *
*/
public abstract class AbstractMoveImageHandler {
+
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
MMenuItem menuItem,
TreeSelection selection = (TreeSelection) mediaView.getViewer().getSelection();
TreePath[] paths = selection.getPaths();
int count = paths[0].getSegmentCount();
- DescriptionBase description = null;
+ DescriptionBase<?> description = null;
for (int i = 0; i < count; i++ ) {
if (paths[0].getSegment(i) instanceof DescriptionBase) {
- description = (DescriptionBase) paths[0].getSegment(i);
+ description = (DescriptionBase<?>) paths[0].getSegment(i);
break;
}
}
- AbstractPostOperation operation = null;
+ AbstractPostOperation<?> operation = null;
// TODO use undo context specific to editor
operation = new MoveMediaInListOperation(menuItem.getLocalizedLabel(),
EditorUtil.getUndoContext(),
+/**
+* Copyright (C) 2018 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.media.handler;
import javax.inject.Named;
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
- AbstractPostOperation operation = null;
+ AbstractPostOperation<?> operation = null;
//select media
Media media = MediaSelectionDialog.select(AbstractUtility.getShell(),// null,
null);
menuItem.setVisible(canExecute);
return canExecute;
}
-
-}
+}
\ No newline at end of file
/**
- *
- */
+* Copyright (C) 2018 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.media.handler;
import javax.inject.Named;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
- *
* @author pplitzner
* @since Aug 14, 2017
- *
*/
public class AddImageGalleryHandler {
- /** {@inheritDoc} */
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem,
UISynchronize sync) {
}
}
}
-
-}
+}
\ No newline at end of file
/**
- *
- */
+* Copyright (C) 2018 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.media.handler;
import javax.inject.Named;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
/**
- *
* @author pplitzner
* @since Aug 14, 2017
- *
*/
public class CreateMediaHandler {
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
- AbstractPostOperation operation = null;
+ AbstractPostOperation<?> operation = null;
// TODO use undo context specific to editor
operation = new AddMediaToImageGalleryOperation(menuItem.getLocalizedLabel(),
EditorUtil.getUndoContext(), (DescriptionBase<?>) selection.getFirstElement(), mediaView);
menuItem.setVisible(canExecute);
return canExecute;
}
-
-}
+}
\ No newline at end of file
/**
- *
- */
+* Copyright (C) 2018 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.media.handler;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import javax.inject.Named;
import eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator.DeleteConfiguratorDialog;
/**
- *
* @author pplitzner
* @since Aug 15, 2017
- *
*/
public class DeleteMediaHandler {
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
TreeSelection selection = (TreeSelection) mediaView.getViewer().getSelection();
- for(Iterator iter = selection.iterator();iter.hasNext();){
+ for(Iterator<?> iter = selection.iterator();iter.hasNext();){
Object object = iter.next();
TreePath[] paths = selection.getPaths();
int count = paths[0].getSegmentCount();
- DescriptionBase description = null;
+ DescriptionBase<?> description = null;
for (int i = 0; i < count; i++ ) {
if (paths[0].getSegment(i) instanceof DescriptionBase) {
- description = (DescriptionBase) paths[0].getSegment(i);
+ description = (DescriptionBase<?>) paths[0].getSegment(i);
break;
}
}
- // TODO use undo context specific to editor
- MediaDeletionConfigurator config = new MediaDeletionConfigurator();
-
- config.setDeleteFromDescription(true);
- config.setOnlyRemoveFromGallery(false);
-
- if (description instanceof SpecimenDescription){
- config.setDeleteFrom(((SpecimenDescription)description).getDescribedSpecimenOrObservation());
- } else if (description instanceof TaxonDescription){
- config.setDeleteFrom(((TaxonDescription)description).getTaxon());
- }else if (description instanceof TaxonNameDescription){
- config.setDeleteFrom(((TaxonNameDescription)description).getTaxonName());
- }
- DeleteConfiguratorDialog dialog;
- dialog = new DeleteConfiguratorDialog(config, shell, Messages.DeleteMediaHandler_CONFIRM, null, Messages.DeleteMediaHandler_CONFIRM_MESSAGE, MessageDialog.WARNING, new String[] { Messages.DeleteMediaHandler_DELETE, Messages.DeleteMediaHandler_SKIP }, 0);
- int result_dialog= dialog.open();
- if (result_dialog != IStatus.OK){
- return;
- }
+
if(object instanceof Media){
- AbstractPostOperation<?> operation = new DeleteMediaOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), description, (Media) object, config, mediaView);
- if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
- if (!config.isOnlyRemoveFromGallery()){
- ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
+ // TODO use undo context specific to editor
+ if (!((Media)object).isPersited()){
+ Set<DescriptionElementBase> elements = description.getElements();
+ if (elements.size() == 1){
+ DescriptionElementBase element = elements.iterator().next();
+ Set<Media> toDelete = new HashSet<>();
+ element.removeMedia((Media)object);
+ ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+ return;
+
+ }
+ }
+ MediaDeletionConfigurator config = fillDeleteConfigurator(shell, description, Messages.DeleteMediaHandler_CONFIRM_MESSAGE_MEDIA);
+ if (config == null){
+ return;
+ }
+ List<Media> mediaList = new ArrayList<>();
+ mediaList.add((Media)object);
+ createMediaDeleteOperation(menuItem.getLocalizedLabel(), sync, mediaView, mediaList, description, config);
+ }
+
+ if(object instanceof DescriptionBase && ((DescriptionBase<?>) object).isImageGallery()){
+ if (!((DescriptionBase<?>)object).getElements().isEmpty()){
+ Set<DescriptionElementBase> elements = description.getElements();
+ boolean containsPersistedMedia = false;
+ DescriptionElementBase element = null;
+ List<Media> mediaList = new ArrayList<>();
+
+ if (elements.size() == 1){
+ element = elements.iterator().next();
+// containsPersistedMedia = element.getMedia().isEmpty();
+ if (element.getMedia() != null && !element.getMedia().isEmpty()){
+ for (Media media: element.getMedia()){
+ containsPersistedMedia |= media.isPersited();
+ if (media.isPersited()){
+ mediaList.add(media);
+ }
+ }
+ }
}
- Media media = (Media)object;
- if (description.isImageGallery()){
- Set<DescriptionElementBase> elements = description.getElements();
- if (elements.size() == 1){
- DescriptionElementBase element = elements.iterator().next();
- element.removeMedia(media);
- if (element.getMedia().isEmpty()){
- description.removeElement(element);
- }
+ if (containsPersistedMedia){
+ MediaDeletionConfigurator config = fillDeleteConfigurator(shell, description, Messages.DeleteMediaHandler_CONFIRM_MESSAGE_DESCRIPTION);
+
+ if (config == null){
+ return;
+ }
+ if (element != null){
+ createMediaDeleteOperation(menuItem.getLocalizedLabel(), sync, mediaView, mediaList, description, config);
}
}
- ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
- ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
- }else{
- AbstractUtility.executeOperation(operation, sync);
}
- }
- if(object instanceof DescriptionBase && ((DescriptionBase) object).isImageGallery()){
+
if(object instanceof TaxonDescription){
+
DeleteTaxonDescriptionOperation deleteTaxonDescriptionOperation = new DeleteTaxonDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (TaxonDescription)object, mediaView, null);
if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
+ ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getTaxon().removeDescription((TaxonDescription)description);
((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(deleteTaxonDescriptionOperation);
((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
}
}
+ public void createMediaDeleteOperation(String menuLabel, UISynchronize sync, MediaViewPartE4 mediaView,
+ List<Media> media, DescriptionBase<?> description, MediaDeletionConfigurator config) {
+ AbstractPostOperation<?> operation = new DeleteMediaOperation(menuLabel, EditorUtil.getUndoContext(), description, media, config, mediaView);
+ if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
+ if (!config.isOnlyRemoveFromGallery()){
+ ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
+ }
+
+ if (description.isImageGallery()){
+ Set<DescriptionElementBase> elements = description.getElements();
+ if (elements.size() == 1){
+ DescriptionElementBase element = elements.iterator().next();
+ Set<Media> toDelete = new HashSet<>();
+ for (Media mediaElement:media){
+ toDelete.add(mediaElement);
+ }
+ for (Media mediaElement:toDelete){
+ element.removeMedia(mediaElement);
+ }
+ }
+ }
+
+ ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
+ ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+ }else{
+ AbstractUtility.executeOperation(operation, sync);
+ }
+ }
+
+ public MediaDeletionConfigurator fillDeleteConfigurator(Shell shell, DescriptionBase<?> description, String message) {
+ MediaDeletionConfigurator config = new MediaDeletionConfigurator();
+
+ config.setDeleteFromDescription(true);
+ config.setOnlyRemoveFromGallery(false);
+
+ if (description instanceof SpecimenDescription){
+ config.setDeleteFrom(((SpecimenDescription)description).getDescribedSpecimenOrObservation());
+ } else if (description instanceof TaxonDescription){
+ config.setDeleteFrom(((TaxonDescription)description).getTaxon());
+ }else if (description instanceof TaxonNameDescription){
+ config.setDeleteFrom(((TaxonNameDescription)description).getTaxonName());
+ }
+ DeleteConfiguratorDialog dialog;
+ dialog = new DeleteConfiguratorDialog(config, shell, Messages.DeleteMediaHandler_CONFIRM, null, message, MessageDialog.WARNING, new String[] { Messages.DeleteMediaHandler_DELETE, Messages.DeleteMediaHandler_SKIP }, 0);
+ int result_dialog= dialog.open();
+ if (result_dialog != IStatus.OK){
+ return null;
+ }
+ return config;
+ }
+
@CanExecute
public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
MHandledMenuItem menuItem){
ISelection selection = mediaView.getViewer().getSelection();
boolean canExecute = selection instanceof TreeSelection && !selection.isEmpty();
- for(Iterator iter = ((TreeSelection) selection).iterator();iter.hasNext();){
+ for(Iterator<?> iter = ((TreeSelection) selection).iterator();iter.hasNext();){
Object object = iter.next();
canExecute &= object instanceof Media
- || (object instanceof DescriptionBase && ((DescriptionBase) object).isImageGallery());
+ || (object instanceof DescriptionBase && ((DescriptionBase<?>) object).isImageGallery());
}
menuItem.setVisible(canExecute);
return canExecute;
package eu.etaxonomy.taxeditor.editor.view.media.operation;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.UUID;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
*/
public class DeleteMediaOperation extends AbstractPostTaxonOperation {
- private final Media media;
+ private final List<Media> media;
private final DescriptionBase<?> description;
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
*/
public DeleteMediaOperation(String label, IUndoContext undoContext,
- DescriptionBase<?> description, Media media, MediaDeletionConfigurator config, IPostOperationEnabled postOperationEnabled) {
+ DescriptionBase<?> description, List<Media> media, MediaDeletionConfigurator config, IPostOperationEnabled postOperationEnabled) {
super(label, undoContext, postOperationEnabled);
this.config = config;
this.media = media;
this.description = description;
}
+ public DeleteMediaOperation(String label, IUndoContext undoContext,
+ DescriptionBase<?> description, Media media, MediaDeletionConfigurator config, IPostOperationEnabled postOperationEnabled) {
+ super(label, undoContext, postOperationEnabled);
+ this.config = config;
+ this.media = new ArrayList<>();
+ this.media.add(media);
+ this.description = description;
+ }
+
+
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
if (monitor != null) {
monitor.worked(20);
}
- if (!config.isOnlyRemoveFromGallery() && media.getId() != 0){
- DeleteResult result = CdmStore.getService(IMediaService.class).delete(media.getUuid(), config);
+ if (!config.isOnlyRemoveFromGallery() ){
+ Set<UUID> toDelete= new HashSet<>();
+ for (Media mediaElement: media){
+ if (mediaElement.getId() != 0){
+ toDelete.add(mediaElement.getUuid());
+ }
+ }
+
+ DeleteResult result = CdmStore.getService(IMediaService.class).delete(toDelete, config);
String errorMessage = "The media ";
if (!result.isOk()){
List<String> messages = new ArrayList<String>();
- int i = result.getExceptions().size();
+
for (Exception e:result.getExceptions()){
messages.add(e.getMessage());
}
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
- ImagesUtility.addMediaToGallery(description, media);
+ for (Media mediaElement: media){
+ ImagesUtility.addMediaToGallery(description, mediaElement);
+ }
return postExecute(null);
}
<feature\r
id="eu.etaxonomy.taxeditor.feature.platform"\r
label="Taxeditor Dependencies"\r
- version="5.20.0"\r
+ version="5.21.0"\r
os="linux,macosx,win32"\r
ws="cocoa,gtk,win32"\r
arch="x86,x86_64">\r
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
<feature\r
id="eu.etaxonomy.taxeditor.feature"\r
label="Taxonomic Editor"\r
- version="5.20.0"\r
+ version="5.21.0"\r
provider-name="EDIT"\r
plugin="eu.etaxonomy.taxeditor.application"\r
os="linux,macosx,win32"\r
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
Bundle-ManifestVersion: 2
Bundle-Name: Help
Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
Bundle-Vendor: EDIT
Require-Bundle: org.eclipse.ui,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: Local
Bundle-SymbolicName: eu.etaxonomy.taxeditor.local;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface,
org.eclipse.ui.ide,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.local</artifactId>
PresenceAbsenceTermDetailElement_LABEL_COLOR=Farbe
PreservationMethodMenuPreferences_select=Auswahl der zur Verf\u00FCgung stehenden Präservierungsmethoden
-DeleteConfiguration_media_removeFromGallery=Entferne Mediendaten aus der Gallerie, aber behalte es in der Datenbank
+DeleteConfiguration_media_removeFromGallery=Entferne Mediendaten aus der Gallerie, aber behalte Mediendatensatz in der Datenbank
DeleteConfiguration_media_deleteIfUsedInTaxonDescription=Lösche die Mediendaten, auch wenn sie Teil einer Taxonbeschreibung ist
DeleteConfiguration_media_deleteIfUsedSomeWhereElse=Lösche die Mediendaten vollständig, auch wenn sie an anderer Stelle verwendet werden
DeleteConfiguration_media_delete=Entferne die Mediendaten aus der Gallerie und lösche sie aus der Datenbank, wenn sie nicht anderweitig verwendet werden.
+++ /dev/null
-cdmlib-remote-webapp.war
+++ /dev/null
-serverName=localhost:8080
-contextPath=remoting
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
-
- <!-- Local application context and term initializer -->
- <import resource="classpath:/eu/etaxonomy/cdm/localApplicationContext.xml"/>
-
- <!-- Remote application context and term initializer -->
- <!-- <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/> -->
-
-</beans>
Bundle-ManifestVersion: 2
Bundle-Name: eu.etaxonomy.taxeditor.molecular.lib
Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular.lib;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-ClassPath: .,
lib/owlapi-xmlutils-4.1.4.jar,
lib/commons-collections4-4.1.jar,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<name>Molecular Library Dependencies Bundle</name>
Bundle-ManifestVersion: 2
Bundle-Name: Molecular Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: Navigation Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.taxeditor.navigation,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
public static String RefreshPolytomousKeyNodesHandler_REFRESHING;
public static String RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON;
public static String RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP;
+ public static String RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title;
+ public static String RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message;
+ public static String RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep;
+ public static String RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent;
+ public static String RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select;
+ public static String RemotingChangeAcceptedTaxonToSynonym_warning_publish;
public static String RemotingDeletePolytomousKeyOperation_DELETE_OP;
public static String RemotingDeleteTaxonNodeHandler_NODE_DELETED;
public static String RemotingDeleteTaxonNodeHandler_NODE_DELETED_MESSAGE;
public static String RemotingMoveTaxonNodeHandler_TARGET_NODE_MESSAGE;
public static String RemotingMoveTaxonNodeHandler_UNSAVED_PARENT;
public static String RemotingMoveTaxonNodeHandler_UNSAVED_PARENT_MESSAGE;
+ public static String RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_TITLE;
+ public static String RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_MESSAGE;
public static String RemotingMoveTaxonOperation_MOVE_OP;
public static String RemotingUpdatePolytomousKeyAllNodesOperation_UPDATE_OP;
public static String Root_CREATE_CLASSIFICATION;
RefreshPolytomousKeyNodesHandler_REFRESHING=Refreshing Polytomous Key Nodes
RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON=Choose the accepted taxon
RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP=Change Accepted Taxon to Synonym operation
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title=Select secundum reference
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message=The secundum reference of the new and the old accepted taxa are not the same. Please select which reference should be used for the new synonym
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep=Keep
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent=From accepted taxon
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select=Select new
+RemotingChangeAcceptedTaxonToSynonym_warning_publish=The accepted taxon and the new synonym have different publish flags. Maybe it should be adapted.
RemotingDeletePolytomousKeyOperation_DELETE_OP=Delete Polytomous Key operation
RemotingDeleteTaxonNodeHandler_NODE_DELETED=Node already deleted
RemotingDeleteTaxonNodeHandler_NODE_DELETED_MESSAGE=The taxon node was already deleted. Please reopen the taxon navigator to refresh the view.
RemotingMoveTaxonNodeHandler_TARGET_NODE_MESSAGE=Do you want to move the Taxonnode as child or behind the target node.
RemotingMoveTaxonNodeHandler_UNSAVED_PARENT=Unsaved Parent Taxon
RemotingMoveTaxonNodeHandler_UNSAVED_PARENT_MESSAGE=There are unsaved changes in the parent taxon. Please save first.
+RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_TITLE=Different publish states
+RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_MESSAGE=The new parent taxon and the moved taxon/taxa do not have the same publish status.
RemotingMoveTaxonOperation_MOVE_OP=Move Taxon operation
RemotingUpdatePolytomousKeyAllNodesOperation_UPDATE_OP=Update All Polytomous Key Nodes operation
Root_CREATE_CLASSIFICATION=Creating initial classification
RefreshPolytomousKeyNodesHandler_REFRESHING=Polytome Schlüssel aktualisieren
RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON=Wählen Sie das akzeptierte Taxon
RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP=Akzeptiertes Taxon in Synonym umwandeln
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title=Auswahl der Secundum Referenz
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message=Die Secundum Referenzen des neuen und des alten akzeptierten Taxons unterscheiden sich, bitte wählen Sie welche Secundum Referenz für das neue Synonym verwendet werden soll
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep=Beibehalten
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent=Vom akzeptierten Taxon
+RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select=Neue auswählen
+RemotingChangeAcceptedTaxonToSynonym_warning_publish=Das akzeptierte Taxon und das neue Synonym haben unterschiedliche Publikationsstatus. Eventuell sollten sie angepasst werden.
RemotingDeletePolytomousKeyOperation_DELETE_OP=Polytomen Schlüssel löschen
RemotingDeleteTaxonNodeHandler_NODE_DELETED=Taxonknoten schon gelöscht
RemotingDeleteTaxonNodeHandler_NODE_DELETED_MESSAGE=Der Taxonknoten wurde schon gelöscht. Bitte Öffnen Sie den Taxonnavigator erneut um die Anzeige zu aktualisieren.
RemotingMoveTaxonNodeHandler_TARGET_NODE_MESSAGE=Wollen Sie den Taxonknoten als Kind oder hinter den Zielknoten verschieben.
RemotingMoveTaxonNodeHandler_UNSAVED_PARENT=Ungespeichertes Eltern-Taxon
RemotingMoveTaxonNodeHandler_UNSAVED_PARENT_MESSAGE=Es gibt ungespeicherte Änderungen im Eltern-Taxon. Bitte speichen Sie erst.
+RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_TITLE=Unterschiedliche Publikationsstatus
+RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_MESSAGE=Das neue Elterntaxon und das verschobene Taxon bzw. die verschobenen Taxa haben unterschiedliche Publikationsstatus.
RemotingMoveTaxonOperation_MOVE_OP=Taxon verschieben
RemotingUpdatePolytomousKeyAllNodesOperation_UPDATE_OP=Alle polytomen Schlüssel updaten
Root_CREATE_CLASSIFICATION=Initiale Klassifikation erstellen
package eu.etaxonomy.taxeditor.navigation.navigator.e4;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Comparator;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.Set;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.preference.NavigatorOrderEnum;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-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.ui.element.LayoutConstants;
*/
public class TaxonNavigatorE4 implements
IPostOperationEnabled, IConversationEnabled, Observer,
- ICdmEntitySessionEnabled, ICdmChangeListener, IContextListener,
+ ICdmChangeListener, IContextListener,
ICollapsableExpandable {
private static final String RESTORING_TAXON_NAVIGATOR = Messages.TaxonNavigator_RESTORE;
private ConversationHolder conversation;
- private ICdmEntitySession cdmEntitySession;
+// private ICdmEntitySession cdmEntitySession;
private IDataChangeBehavior dataChangeBehavior;
updateSyncButton();
-
-
init();
}
}
}
- /** {@inheritDoc} */
protected IAdaptable getInitialInput() {
Comparator<TaxonNodeDto> comparator;
NavigatorOrderEnum orderValue = NavigatorOrderEnum.RankAndNameOrder;
conversation.registerForDataStoreChanges(TaxonNavigatorE4.this);
}
if (CdmStore.isActive()) {
- cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+// cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
CdmApplicationState.getCurrentDataChangeService().register(this);
viewer.setInput(getInitialInput());
}
}else{
//TODO: show message in status bar
}
-
}
}
}
}
if(!viewer.getTree().isDisposed()){
if (CdmStore.isActive()){
+
viewer.setInput(getInitialInput());
}
viewer.refresh();
return;
}
int mementoWork = 0;
- Set<TreePath> treePaths = new HashSet<TreePath>();
+ Set<TreePath> treePaths = new HashSet<>();
IMemento[] treePathMementos = null;
IMemento treePathsMemento = memento.getChild(TREE_PATHS);
private TreePath createTreePathFromString(String string) {
- List<CdmBase> pathList = new ArrayList<CdmBase>();
+ List<CdmBase> pathList = new ArrayList<>();
if (string.length() == 0) {
return null;
return new TreePath(pathList.toArray());
}
- /**
- * {@inheritDoc}
- */
@Override
public void collapse() {
viewer.collapseAll();
}
- /**
- * {@inheritDoc}
- */
@Override
public void expand() {
viewer.expandAll();
return conversation;
}
- /** {@inheritDoc} */
@PreDestroy
public void dispose() {
dataChangeBehavior = null;
conversation.unregisterForDataStoreChanges(this);
conversation.close();
}
- if(cdmEntitySession != null) {
- cdmEntitySession.dispose();
- cdmEntitySession = null;
- }
if(CdmApplicationState.getCurrentDataChangeService() != null) {
CdmApplicationState.getCurrentDataChangeService().unregister(this);
}
}
- /** {@inheritDoc} */
@Focus
public void setFocus() {
if (getConversationHolder() != null) {
getConversationHolder().bind();
}
- if(cdmEntitySession != null) {
- cdmEntitySession.bind();
- }
}
public UISynchronize getSync() {
return undoContext;
}
- /** {@inheritDoc} */
@Override
public boolean postOperation(Object objectAffectedByOperation) {
viewer.refresh();
if(o instanceof LoginManager){
refresh();
}
-
}
- /** {@inheritDoc} */
+
@Override
public void update(CdmDataChangeMap changeEvents) {
if (dataChangeBehavior == null) {
}
- @Override
- public ICdmEntitySession getCdmEntitySession() {
- return cdmEntitySession;
- }
-
- @Override
public List<TaxonNodeDto> getRootEntities() {
if(root != null) {
return root.getParentBeans();
viewer.setExpandedElements(expandedElements);
}
- @Override
- public Map<Object, List<String>> getPropertyPathsMap() {
- Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
- List<String> taxonNodePropertyPaths = Arrays.asList(new String[] {
- "taxon.name" //$NON-NLS-1$
- });
- propertyPathsMap.put("childNodes", taxonNodePropertyPaths); //$NON-NLS-1$
- return propertyPathsMap;
- }
-
@Override
public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
// TODO Auto-generated method stub
-
}
@Override
if(dto!= null){
Object[] expandedElements = viewer.getExpandedElements();
ISelection sel = viewer.getSelection();
- refresh();
+ refresh(dto);
viewer.setExpandedElements(expandedElements);
if (sel != null && !sel.isEmpty()){
viewer.reveal(dto);
viewer.setSelection(sel);
}
-
}
}
Object[] expandedElements = viewer.getExpandedElements();
refresh();
viewer.setExpandedElements(expandedElements);
-
}
}
-}
+}
\ No newline at end of file
* 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.navigation.navigator.e4;
import java.util.ArrayList;
this.taxonNavigator = navigator;
}
- /** {@inheritDoc} */
@Override
public boolean performDrop(Object data) {
Object target = getCurrentTarget();
}
private Set<TaxonNodeDto> getSelectedTaxa(){
- taxonNodes = new HashSet();
+ taxonNodes = new HashSet<>();
ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
if (selection instanceof TreeSelection) {
return taxonNodes;
}
- /** {@inheritDoc} */
@Override
public boolean validateDrop(Object target, int operation,
TransferData transferType) {
boolean isNotSameParent = true;
for(TaxonNodeDto taxonNode : getSelectedTaxa()){
if (logger.isDebugEnabled()){
- logger.debug("selectedTaxa: " + taxonNode.getTaxonUuid() == null? "-" : taxonNode.getTitleCache()); //$NON-NLS-1$
+ logger.debug("selectedTaxa: " + (taxonNode.getTaxonUuid() == null? "-" : taxonNode.getTitleCache())); //$NON-NLS-1$
}
boolean isClassification = taxonNode.getTaxonUuid()== null;
if (isClassification) {
}
logger.debug("OK_STATUS"); //$NON-NLS-1$
return true;
-
}
-
private boolean moveTaxon(Set<TaxonNodeDto> taxonNodes, TaxonNodeDto targetITaxonTreeNode) {
Iterator<TaxonNodeDto> taxIterator = taxonNodes.iterator();
this.targetITaxonTreeNode = targetITaxonTreeNode;
Set<UUID> uuids = new HashSet<UUID>();
TaxonNodeDto node = null;
+ boolean targetIsPublish = targetITaxonTreeNode.isPublish();
+ boolean isPublishEqual = true;
while(taxIterator.hasNext()){
node = taxIterator.next();
uuids.add(node.getUuid());
+ isPublishEqual &= targetIsPublish == node.isPublish();
}
+ if (!isPublishEqual){
+ MessageDialog.openWarning(null, "Publish status differ", Messages.RemotingChangeAcceptedTaxonToSynonym_warning_publish);
+ }
+
IUndoContext workspaceUndoContext = taxonNavigator.getUndoContext();
int movingTypeInt = 0;
if (PreferencesUtil.isNodesSortedNaturally()){
} else {
return false;
}
-
-
}
moveNodes(uuids, targetITaxonTreeNode.getUuid(), movingTypeInt);
return true;
});
}
-
@Override
public void dragOver(DropTargetEvent event) {
super.dragOver(event);
event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_INSERT_AFTER | DND.FEEDBACK_SCROLL;
}
- /**
- * {@inheritDoc}
- */
@Override
public void postOperation(IRemotingProgressMonitor monitor) {
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, targetITaxonTreeNode);
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, targetITaxonTreeNode.getTaxonUuid());
}
-
-}
+}
\ No newline at end of file
config,
taxonNavigator,
taxonNavigator,
- taxonNavigator);
+ null);
AbstractUtility.executeOperation(operation, sync);
new TaxonDeletionConfigurator(),
taxonNavigator,
taxonNavigator,
- taxonNavigator);
+ null);
AbstractUtility.executeOperation(operation, sync);
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
+ if (activePart.getObject() instanceof TaxonNavigatorE4){
+ TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
- TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
-
- taxonNavigator.refresh();
+ taxonNavigator.refresh();
+ }
}
@CanExecute
/**
- *
- */
+* Copyright (C) 2018 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.navigation.navigator.e4.handler;
import java.util.HashSet;
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
/**
- *
* @author pplitzner
* @since Sep 6, 2017
- *
*/
public class RemotingChangeAcceptedTaxonToSynonymHandlerE4 extends RemotingCdmHandlerE4 {
-
- private Set<TaxonNodeDto> oldTaxonNodes = new HashSet();
+ private Set<TaxonNodeDto> oldTaxonNodes = new HashSet<>();
private Classification classification;
+ protected boolean isSetSource = false;
public RemotingChangeAcceptedTaxonToSynonymHandlerE4() {
super(TaxonNavigatorLabels.CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL);
}
// check that selected object is a taxon node
- Iterator it = selection.iterator();
+ Iterator<?> it = selection.iterator();
Classification nextClassification;
oldTaxonNodes = new HashSet<>();
while(it.hasNext()){
MPart activePart,
MHandledMenuItem menuItem) {
Set<UUID> excludeTaxa = new HashSet<>();
+ Set<UUID> secUuids = new HashSet<>();
+ Set<UUID> nodeUuids = new HashSet<>();
+ boolean published = true;
+
for (TaxonNodeDto oldNode:oldTaxonNodes){
excludeTaxa.add(oldNode.getTaxonUuid());
+ secUuids.add(oldNode.getSecUuid());
+ nodeUuids.add(oldNode.getUuid());
+
}
TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
// new ConversationHolderMock(),
if (newAcceptedTaxonNode == null) {
return null;
}
- Set<UUID> nodeUuids = new HashSet();
- for (TaxonNodeDto node: oldTaxonNodes){
- nodeUuids.add(node.getUuid());
+
+ SecReferenceHandlingEnum secHandling = PreferencesUtil.getSecReferenceHandlingPreference();
+ UUID newSecUuid = null;
+ UUID newTaxonUuid = newAcceptedTaxonNode.getTaxon() != null && newAcceptedTaxonNode.getTaxon().getSec() != null ? newAcceptedTaxonNode.getTaxon().getSec().getUuid(): null;
+ //the moved taxa have different secundum references
+ if (secUuids.size() > 1 && !(secHandling.equals(SecReferenceHandlingEnum.KeepAlways) || secHandling.equals(SecReferenceHandlingEnum.AlwaysDelete))){
+ int result = MessagingUtils.confirmDialog(Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message,
+ new String[]{Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select});
+ if (result == 2){
+ //select new reference
+ Reference sec = ReferenceSelectionDialog.select(shell, null);
+ newSecUuid = sec != null? sec.getUuid(): null;
+ }else if (result == 1){
+ //use parent sec
+ newSecUuid = newTaxonUuid;
+ }else if (result == 0){
+ //keep sec (also homotypic synonyms with different sec will keep the secundum)
+ secHandling = SecReferenceHandlingEnum.KeepAlways;
+ }else{
+ return null;
+ }
+ }else{
+ UUID oldSecUuid = secUuids.iterator().next();
+ //the nodes moved have all the same sec, but the accepted taxon has a different one
+ if ((secUuids.size() > 0 &&
+ ((newTaxonUuid != null && oldSecUuid != null && !newTaxonUuid.equals(oldSecUuid))
+ || (newTaxonUuid != null && oldSecUuid == null) ||(newTaxonUuid == null && oldSecUuid != null))
+ && secHandling.equals(SecReferenceHandlingEnum.KeepWhenSame) )|| secHandling.equals(SecReferenceHandlingEnum.WarningSelect)){
+ int result = MessagingUtils.confirmDialog(Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_title, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Handling_message,
+ new String[]{Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Keep, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Parent, Messages.RemotingChangeAcceptedTaxonToSynonymHandler_Select_Sec_Reference_Select});
+ if (result == 2){
+ Reference sec = ReferenceSelectionDialog.select(shell, null);
+ newSecUuid = sec != null? sec.getUuid(): null;
+ }else if (result == 1){
+ newSecUuid = newTaxonUuid;
+ }else if (result == 0){
+ secHandling = SecReferenceHandlingEnum.KeepAlways;
+
+ }else{
+ return null;
+ }
+ }
}
+
RemotingChangeAcceptedTaxonToSynonymOperation rcattso =
new RemotingChangeAcceptedTaxonToSynonymOperation(getTrigger(),
false,
nodeUuids,
- newAcceptedTaxonNode.getUuid(), partService, activePart, application, false);
+ newAcceptedTaxonNode.getUuid(), newSecUuid, secHandling, partService, activePart, application, isSetSource);
return rcattso;
}
public void onComplete() {
}
- /**
- * {@inheritDoc}
- */
@Override
protected Object getTrigger() {
return this;
}
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.inject.Named;
-
-import org.eclipse.core.commands.operations.AbstractOperation;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.e4.core.di.annotations.CanExecute;
-import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
-import org.eclipse.e4.ui.services.IServiceConstants;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.widgets.Shell;
-
-import eu.etaxonomy.cdm.api.service.IClassificationService;
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
-import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
-import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingChangeAcceptedTaxonToSynonymOperation;
-import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
-
/**
*
* @author pplitzner
* @since Sep 6, 2017
*
*/
-public class RemotingChangeAcceptedTaxonToSynonymSetNameInSourceHandlerE5 extends RemotingCdmHandlerE4 {
-
+public class RemotingChangeAcceptedTaxonToSynonymSetNameInSourceHandlerE5 extends RemotingChangeAcceptedTaxonToSynonymHandlerE4 {
- private Set<TaxonNodeDto> oldTaxonNodes = new HashSet();
- private Classification classification;
public RemotingChangeAcceptedTaxonToSynonymSetNameInSourceHandlerE5() {
- super(TaxonNavigatorLabels.CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL);
+ super();
+ isSetSource = true;
}
- @Override
- public IStatus allowOperations(IStructuredSelection selection,
- Shell shell,
- MPart activePart,
- MHandledMenuItem menuItem) {
- // check that only a single taxon tree node has been selected
-// if(selection.size() > 1) {
-// return new Status(IStatus.ERROR,
-// "unknown", //$NON-NLS-1$
-// TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
-// }
-
- // check for no taxon tree node selected
- if(selection.size() == 0) {
- return new Status(IStatus.ERROR,
- "unknown", //$NON-NLS-1$
- TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
- }
-
- // check that selected object is a taxon node
- Iterator it = selection.iterator();
- Classification nextClassification;
- oldTaxonNodes = new HashSet<>();
- while(it.hasNext()){
- Object obj = it.next();
- if(obj instanceof TaxonNodeDto) {
- oldTaxonNodes.add((TaxonNodeDto)obj);
- nextClassification = CdmStore.getService(IClassificationService.class).find(((TaxonNodeDto)obj).getClassificationUUID());
- if (classification == null){
- classification = nextClassification;
- }else if (!classification.equals(nextClassification)){
- return new Status(IStatus.ERROR,
- "unknown", //$NON-NLS-1$
- TaxonNavigatorLabels.ACCEPTED_TAXA_NEED_TO_BE_FROM_SAME_CLASSIFICATION);
- }
- } else {
- if (obj instanceof TaxonNode && !((TaxonNode)obj).hasTaxon()){
- return new Status(IStatus.ERROR,
- "Operation not available for Classifications", //$NON-NLS-1$
- TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
- }
- return new Status(IStatus.ERROR,
- "unknown", //$NON-NLS-1$
- TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
- }
- // check that the source taxon node does not have children
- if(((TaxonNodeDto)obj).getTaxonomicChildrenCount() > 0) {
- return new Status(IStatus.ERROR,
- "unknown", //$NON-NLS-1$
- TaxonNavigatorLabels.SOURCE_TAXON_HAS_CHILDREN_MESSAGE);
-
- }
-
- // check if corresponding name editor is closed
- EditorUtil.closeObsoleteEditor((TaxonNodeDto)obj, partService);
- }
- return Status.OK_STATUS;
- }
- @Override
- public AbstractOperation prepareOperation(IStructuredSelection selection,
- Shell shell,
- MPart activePart,
- MHandledMenuItem menuItem) {
- Set<UUID> excludeTaxa = new HashSet<>();
- for (TaxonNodeDto oldNode:oldTaxonNodes){
- excludeTaxa.add(oldNode.getTaxonUuid());
- }
- TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
-// new ConversationHolderMock(),
- Messages.RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON,
- excludeTaxa,
- null,
- classification.getUuid());
-
- if (newAcceptedTaxonNode == null) {
- return null;
- }
- Set<UUID> nodeUuids = new HashSet();
- for (TaxonNodeDto node: oldTaxonNodes){
- nodeUuids.add(node.getUuid());
- }
- RemotingChangeAcceptedTaxonToSynonymOperation rcattso =
- new RemotingChangeAcceptedTaxonToSynonymOperation(getTrigger(),
- false,
- nodeUuids,
- newAcceptedTaxonNode.getUuid(), partService, activePart, application, true);
-
- return rcattso;
- }
-
- @CanExecute
- private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
- boolean canExecute = !selection.isEmpty();
- Object[] array = selection.toArray();
- for (Object object : array) {
- canExecute &= (object instanceof TaxonNodeDto) && ((TaxonNodeDto)selection.getFirstElement()).getTaxonUuid() != null;
- }
- menuItem.setVisible(canExecute);
- return canExecute;
- }
-
- @Override
- public void onComplete() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Object getTrigger() {
- return this;
- }
}
*/
public class RemotingDeleteTaxonNodeHandlerE4 extends RemotingCdmHandlerE4 {
+ protected static final String SKIP = Messages.DeleteHandler_SKIP;
+ protected static final String MOVE_CHILDREN_TO_PARENT_NODE = Messages.DeleteHandler_MOVE_TO_PARENT;
+ protected static final String DELETE_ALL_CHILDREN = Messages.DeleteHandler_DELETE_ALL;
+ protected static final String THERE_ARE_CHILDNODES_WHICH_WILL_BE_DELETED_TOO = Messages.DeleteHandler_THERE_ARE_CHILDNODES;
+ protected static final String THE_TREE_HAS_CHILDREN_THEY_WILL_BE_DELETED_TOO = Messages.DeleteHandler_THERE_ARE_CHILDREN;
+
+ protected static final String DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE_S = Messages.DeleteHandler_DELETE_NODES;
+ protected static final String DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE = Messages.DeleteHandler_DELETE_NODE;
+
+ protected static final String DO_YOU_REALLY_WANT_TO_DELETE_THE_CLASSIFICATION = Messages.DeleteHandler_DELETE_CLASSIFICATION;
+ protected static final String CONFIRM_DELETION = Messages.DeleteHandler_CONFIRM_DELETE;
+ protected static final String DELETE = Messages.DeleteHandler_DELETE;
+
private TaxonDeletionConfigurator config;
private Set<TaxonNodeDto> treeNodes;
private Set<TaxonNodeDto> classifications;
}
- if (containsClassification && !containsTaxonNodes) {
- String message;
- if (containsClassification && containsNodeWithChildren) {
- message = DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_CLASSIFICATION+DeleteHandlerE4.THE_TREE_HAS_CHILDREN_THEY_WILL_BE_DELETED_TOO;
- } else {
- message = DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_CLASSIFICATION;
- }
- if (!MessageDialog.openConfirm(
- shell, DeleteHandlerE4.CONFIRM_DELETION,
- message)) {
- return Status.CANCEL_STATUS;
- }
+ if (containsClassification && !containsTaxonNodes) {
+ String message;
+ if (containsClassification && containsNodeWithChildren) {
+ message = DO_YOU_REALLY_WANT_TO_DELETE_THE_CLASSIFICATION+THE_TREE_HAS_CHILDREN_THEY_WILL_BE_DELETED_TOO;
+ } else {
+ message = DO_YOU_REALLY_WANT_TO_DELETE_THE_CLASSIFICATION;
+ }
+ if (!MessageDialog.openConfirm(
+ shell, CONFIRM_DELETION,
+ message)) {
+ return Status.CANCEL_STATUS;
}
- else {
- String confirmMessage= treeNodes.size() == 1?DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE:DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE_S;
- if (containsNodeWithChildren){
-
- DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
- config,
- shell,
- DeleteHandlerE4.CONFIRM_DELETION,
- null,
- DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE+DeleteHandlerE4.THERE_ARE_CHILDNODES_WHICH_WILL_BE_DELETED_TOO,
- MessageDialog.WARNING, new String[] { DeleteHandlerE4.DELETE_ALL_CHILDREN,
- DeleteHandlerE4.MOVE_CHILDREN_TO_PARENT_NODE, DeleteHandlerE4.SKIP }, 0);
- int result = dialog.open();
-
- if (result == 0){
- //delete all children
- config.getTaxonNodeConfig().setChildHandling(ChildHandling.DELETE);
- } else if (result == 1){
- //move children
- config.getTaxonNodeConfig().setChildHandling(ChildHandling.MOVE_TO_PARENT);
- } else {
- return Status.CANCEL_STATUS;
- }
- } else{
-
- DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
- config,
- shell,
- DeleteHandlerE4.CONFIRM_DELETION,
- null,
- confirmMessage,
- MessageDialog.WARNING, new String[] { DeleteHandlerE4.DELETE, DeleteHandlerE4.SKIP }, 0);
- int result = dialog.open();
- if (result == 0){
- //delete all children
-
- config.getTaxonNodeConfig().setChildHandling(ChildHandling.DELETE);
- } else {
- return Status.CANCEL_STATUS;
- }
-// if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(configNodes, shell, DeleteHandlerE4.CONFIRM_DELETION, DeleteHandlerE4.DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE_S)){
-// return Status.CANCEL_STATUS;
-// }
-// config.setTaxonNodeConfig(configNodes);
+ }
+ else {
+ String confirmMessage= treeNodes.size() == 1?DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE: DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE_S;
+ if (containsNodeWithChildren){
+
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
+ config,
+ shell,
+ CONFIRM_DELETION,
+ null,
+ DO_YOU_REALLY_WANT_TO_DELETE_THE_SELECTED_NODE+THERE_ARE_CHILDNODES_WHICH_WILL_BE_DELETED_TOO,
+ MessageDialog.WARNING, new String[] { DELETE_ALL_CHILDREN,
+ MOVE_CHILDREN_TO_PARENT_NODE, SKIP }, 0);
+ int result = dialog.open();
+
+ if (result == 0){
+ //delete all children
+ config.getTaxonNodeConfig().setChildHandling(ChildHandling.DELETE);
+ } else if (result == 1){
+ //move children
+ config.getTaxonNodeConfig().setChildHandling(ChildHandling.MOVE_TO_PARENT);
+ } else {
+ return Status.CANCEL_STATUS;
+ }
+ } else{
+
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
+ config,
+ shell,
+ CONFIRM_DELETION,
+ null,
+ confirmMessage,
+ MessageDialog.WARNING, new String[] { DELETE, SKIP }, 0);
+ int result = dialog.open();
+ if (result == 0){
+ //delete all children
+
+ config.getTaxonNodeConfig().setChildHandling(ChildHandling.DELETE);
+ } else {
+ return Status.CANCEL_STATUS;
}
}
-// }
+ }
+
return Status.OK_STATUS;
}
private Set<UUID> oldTaxonNodeUUIDs = new HashSet<>();
private TaxonNavigatorE4 navigator;
private UUID classificationUuid = null;
+ boolean isPublish = true;
public RemotingMoveTaxonNodeHandlerE4() {
super(TaxonNavigatorLabels.MOVE_TAXON_LABEL);
Object obj ;
Iterator iter = selection.iterator();
oldTaxonNodeUUIDs = new HashSet<>();
+ isPublish = true;
while (iter.hasNext()){
obj = iter.next();
if(obj instanceof TaxonNodeDto) {
oldTaxonNodeUUIDs.add(((TaxonNodeDto)obj).getUuid());
+ isPublish &= ((TaxonNodeDto)obj).isPublish();
if (classificationUuid == null){
classificationUuid = ((TaxonNodeDto)obj).getClassificationUUID();
}
classificationUuid, true);
}
+ if (parentTaxonNode.getTaxon().isPublish() != isPublish){
+ MessageDialog.openWarning(shell,
+ Messages.RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_TITLE,
+ Messages.RemotingMoveTaxonNodeHandler_DIFFERENT_PUBLISH_MESSAGE);
+ }
if(parentTaxonNode != null){
if(NavigationUtil.isDirty(parentTaxonNode, partService)){
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.service.DeleteResult;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
private Set<UUID> oldTaxonNodeUuids = new HashSet();
private final UUID newAcceptedTaxonNodeUuid;
+ private UUID secundumUuid;
private boolean setNameInSource ;
+ private SecReferenceHandlingEnum secHandling;
private final static String LABEL = Messages.RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP;
boolean async,
Set<UUID> oldTaxonNodeUuids,
UUID newAcceptedTaxonNodeUuid,
+ UUID newSecUuid,
+ SecReferenceHandlingEnum secHandling,
EPartService partService,
MPart activePart,
MApplication application,
this.oldTaxonNodeUuids.addAll(oldTaxonNodeUuids);
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
this.setNameInSource = setNameInSource;
+ this.secundumUuid = newSecUuid;
+ this.secHandling = secHandling;
}
boolean async,
UUID oldTaxonNodeUuid,
UUID newAcceptedTaxonNodeUuid,
+ UUID newSecUuid,
+ SecReferenceHandlingEnum secHandling,
EPartService partService,
MPart activePart,
MApplication application,
this.oldTaxonNodeUuids.add(oldTaxonNodeUuid);
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
this.setNameInSource = setNameInSource;
+ this.secundumUuid = newSecUuid;
+ this.secHandling = secHandling;
}
/**
boolean async,
UUID oldTaxonNodeUuid,
UUID newAcceptedTaxonNodeUuid,
+ UUID newSecUuid,
+ SecReferenceHandlingEnum secHandling,
boolean setNameInSource) {
super(LABEL, Action.Update, source, async);
this.oldTaxonNodeUuids.add(oldTaxonNodeUuid);
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
this.setNameInSource = setNameInSource;
+ this.secundumUuid = newSecUuid;
+ this.secHandling = secHandling;
}
/* (non-Javadoc)
updateResult = CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNodeUuids.iterator().next(),
newAcceptedTaxonNodeUuid,
null,
+ secundumUuid,
null,
- null,
+ secHandling,
setNameInSource);//TODO
}else{
updateResult = CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeSynonymsOfAnotherTaxonNode(oldTaxonNodeUuids,
newAcceptedTaxonNodeUuid,
null,
+ secundumUuid,
null,
- null,
+ secHandling,
setNameInSource);//TODO
}
+ boolean oldTaxaPublished = true;
+ for (CdmBase delObject:((DeleteResult)updateResult).getDeletedObjects()){
+ if (delObject instanceof TaxonBase){
+ oldTaxaPublished &= ((TaxonBase)delObject).isPublish();
+ }
+ }
+ Taxon newTaxon = null;
+ for (CdmBase updatedObject: updateResult.getUpdatedObjects()){
+ if (updatedObject instanceof Taxon){
+ for (TaxonNode node: ((Taxon)updatedObject).getTaxonNodes()){
+ if (node.getUuid().equals(newAcceptedTaxonNodeUuid)){
+ newTaxon = (Taxon)updatedObject;
+ break;
+ }
+ }
+ }
+
+ }
+ if (newTaxon != null && oldTaxaPublished != newTaxon.isPublish()){
+ MessagingUtils.warningDialog("Publish flag", null, Messages.RemotingChangeAcceptedTaxonToSynonym_warning_publish);
+ }
updateNameEditor();
return updateResult;
if (part == activePart){
setFocus = true;
}
- if (object instanceof TaxonNameEditorE4){
+ if (part.getContributionURI().endsWith("TaxonNameEditorE4")){
+
+ }
+ if (object instanceof TaxonNameEditorE4 ){
Set<TaxonNode> nodes = ((TaxonNameEditorE4)object).getTaxon().getTaxonNodes();
for (TaxonNode node: nodes){
- if (node.getTaxon().getUuid().equals(newAcceptedTaxonNodeUuid)){
+ if (node.getUuid().equals(newAcceptedTaxonNodeUuid)){
EditorUtil.updateEditor(node, (TaxonNameEditorE4)object);
}
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
-import eu.etaxonomy.taxeditor.navigation.navigator.e4.TaxonNavigatorE4;
import eu.etaxonomy.taxeditor.navigation.navigator.e4.TreeNodeDropAdapterE4.MovingType;
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
/**
* @author cmathew
* @date 19 Jun 2015
- *
*/
public class RemotingMoveTaxonOperation extends RemotingCdmUpdateOperation implements IPostMoniteredOperationEnabled {
private Set<UUID> taxonNodesToMoveUuid;
private final UUID newParentTreeNodeUuid;
private final MovingType moveToParentNode;
- private TaxonNavigatorE4 taxonNavigator;
public RemotingMoveTaxonOperation(Object source,
boolean async,
taxonNodesToMoveUuid = taxonNodeToMoveUuid;
this.newParentTreeNodeUuid = newParentTreeNodeUuid;
this.moveToParentNode = moveToParentNode;
-
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
@Override
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
runMoniteredOperation();
}
public void runMoniteredOperation() {
- ITaxonNodeService nodeService;
final UUID uuid;
int movingTypeInt = -1;
switch (this.moveToParentNode) {
}
});
}
-
-
}
- /**
- * {@inheritDoc}
- */
@Override
public void postOperation(IRemotingProgressMonitor monitor) {
monitor.done();
TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).dto(newParentTreeNodeUuid);
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, parentDto);
-
}
-
-}
+}
\ No newline at end of file
Bundle-ManifestVersion: 2
Bundle-Name: Printpublisher Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Export-Package: eu.etaxonomy.cdm.print,
eu.etaxonomy.cdm.print.out,
eu.etaxonomy.cdm.print.out.odf,
eu.etaxonomy.taxeditor.editor,
eu.etaxonomy.taxeditor.store
Bundle-ClassPath: .,
- lib/cdmlib-print-5.20.0.jar,
- lib/cdmlib-remote-5.20.0.jar
+ lib/cdmlib-print-5.21.0.jar,
+ lib/cdmlib-remote-5.21.0.jar
Import-Package: org.apache.log4j,
org.eclipse.core.runtime,
org.eclipse.core.runtime.jobs,
bin.includes = META-INF/,\
.,\
plugin.xml,\
- lib/cdmlib-print-5.20.0.jar,\
- lib/cdmlib-remote-5.20.0.jar,\
+ lib/cdmlib-print-5.21.0.jar,\
+ lib/cdmlib-remote-5.21.0.jar,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/l10n/bundle_de.properties,\
<parent>
<artifactId>taxeditor-parent</artifactId>
<groupId>eu.etaxonomy</groupId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: DataStore Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
Bundle-Vendor: EDIT
Bundle-Localization: OSGI-INF/l10n/bundle
-Export-Package: eu.etaxonomy.cdm,
- eu.etaxonomy.taxeditor.editor,
+Export-Package: eu.etaxonomy.taxeditor.editor,
eu.etaxonomy.taxeditor.editor.definedterm,
eu.etaxonomy.taxeditor.editor.definedterm.input,
eu.etaxonomy.taxeditor.event,
handledmenuitem.label.49 = Specimentypedesignation Status\r
handledmenuitem.label.50 = Taxonnode Agent Relation Type\r
handledmenuitem.label.51 = Language\r
+page.name.secundum = Secundum Reference\r
\r
handledmenuitem.label.52 = Öffnen in ...\r
handledmenuitem.label.49 = Kategorie der Belegtypisierung
handledmenuitem.label.50 = Relationstyp: Taxon-Knoten/Agierende
handledmenuitem.label.51 = Sprache
+page.name.secundum = Secundum Referenz
+
handledmenuitem.label.52 = Öffnen in ...
type="org.eclipse.jface.viewers.IStructuredSelection">
</propertyTester>
<propertyTester
- class="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
- id="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
- namespace="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
- properties="isFeatureTree"
+ class="eu.etaxonomy.taxeditor.featuretree.TermTreePropertyTester"
+ id="eu.etaxonomy.taxeditor.featuretree.TermTreePropertyTester"
+ namespace="eu.etaxonomy.taxeditor.featuretree.TermTreePropertyTester"
+ properties="isTermTree"
type="org.eclipse.jface.viewers.IStructuredSelection">
</propertyTester>
</extension>
selection="eu.etaxonomy.cdm.model.taxon.TaxonNode"
viewerName="%viewCommandMapping.viewerName.TAXON_NODE_WIZARD">
</viewCommandMapping>
+ <viewCommandMapping
+ commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
+ selection="eu.etaxonomy.cdm.persistence.dto.TermNodeDto"
+ viewerName="Vocabulary">
+ </viewCommandMapping>
</extension>
<extension
id="eu.etaxonomy.taxeditor.store.workbench.model"
id="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
name="%page.name.52">
</page>
- <page
+ <page
category="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
class="eu.etaxonomy.taxeditor.preference.PublishFlagLocalPreference"
id="eu.etaxonomy.taxeditor.preferences.publishFlagPreference"
name="%page.name.46">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
+ class="eu.etaxonomy.taxeditor.preference.SecundumReferenceHandling"
+ id="eu.etaxonomy.taxeditor.preferences.secundumPreference"
+ name="%page.name.secundum">
+ </page>
<page
category="eu.etaxonomy.taxeditor.preferences.general"
class="eu.etaxonomy.taxeditor.preference.UIPreferences"
name="%page.name.42">
</page>
<page
- category="eu.etaxonomy.taxeditor.preferences.general"
+ category="eu.etaxonomy.taxeditor.preferences.general"
+ class="eu.etaxonomy.taxeditor.preference.TaxonPreferences"
+ id="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
+ name="%page.name.52">
+ </page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.PublishFlagPreference"
id="eu.etaxonomy.taxeditor.preferences.publishFlagPreference"
name="%page.name.46">
+ </page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.taxonPreferences"
+ class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.SecundumReferenceHandlingAdmin"
+ id="eu.etaxonomy.taxeditor.preferences.secRefHandling"
+ name="%page.name.secundum">
</page>
<page
category="eu.etaxonomy.taxeditor.preferences.namePreferences"
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
--- /dev/null
+/**
+* Copyright (C) 2020 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.databaseAdmin.preferencePage;
+
+import eu.etaxonomy.cdm.api.application.ICdmRepository;
+import eu.etaxonomy.cdm.api.service.IPreferenceService;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.SecundumReferenceHandling;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @since Dec 1, 2020
+ */
+public class SecundumReferenceHandlingAdmin extends SecundumReferenceHandling {
+
+ @Override
+ public void init() {
+ super.init();
+
+
+ }
+
+
+
+ @Override
+ public boolean performOk() {
+ if (!isApply()){
+ return true;
+ }
+ ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration();
+ if (controller == null){
+ return false;
+ }
+ IPreferenceService service = controller.getPreferenceService();
+ String textCombo = synonymSecundumBehaviour.getText();
+ String text = null;
+ // default -> delete preference
+ if(textCombo.startsWith(Messages.Preference_Use_Default) && allowOverride){
+ service.remove(pref.getKey());
+ PreferencesUtil.updateDBPreferences();
+ return true;
+ }else if (textCombo.startsWith(Messages.Preference_Use_Default)){
+ text = null;
+ }else{
+ for (SecReferenceHandlingEnum display: SecReferenceHandlingEnum.values()){
+ if (display.getLabel().equals(textCombo)){
+ text = display.getKey();
+ break;
+ }
+ }
+ }
+ CdmPreference preference = CdmPreference.NewInstance(pref.getKey(), text);
+ preference.setAllowOverride(allowOverride);
+
+ service.set(preference);
+ PreferencesUtil.updateDBPreferences();
+
+ return true;
+ }
+
+
+
+ @Override
+ public void getValues() {
+ super.getValues();
+ isAdminPreference = true;
+
+
+ }
+}
-// $Id$
/**
* Copyright (C) 2018 EDIT
* European Distributed Institute of Taxonomy
*/
package eu.etaxonomy.taxeditor.editor.definedterm;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
-import eu.etaxonomy.cdm.model.term.TermTree;
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.taxeditor.featuretree.TermTreeLabelProvider;
/**
- *
* @author pplitzner
* @since May 24, 2019
*/
public class FeatureTreeViewerComparator extends ViewerComparator {
+ private TermTreeLabelProvider labelProvider = new TermTreeLabelProvider();
+
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
- if(e1 instanceof TermTree && e2 instanceof TermTree) {
- return ((TermTree<?>)e1).getTitleCache().toLowerCase().compareTo(((TermTree<?>) e2).getTitleCache().toLowerCase());
+
+ String label1 = "";
+ String label2 = "";
+
+ if (e1 instanceof TermNodeDto ){
+ if (((TermNodeDto)e1).getTree().isOrderRelevant()){
+ return 0;
+ }
}
- return 0;
+
+ if (StringUtils.isBlank(label1)){
+ label1 = labelProvider.getText(e1);
+ }
+ if (StringUtils.isBlank(label2)){
+ label2 = labelProvider.getText(e2);
+ }
+
+ //compare
+ return CdmUtils.Nz(label1).toLowerCase().compareTo(CdmUtils.Nz(label2).toLowerCase());
}
}
*/
package eu.etaxonomy.taxeditor.editor.definedterm;
+import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.TextStyle;
import org.eclipse.swt.widgets.Display;
* @since Oct 29, 2018
*
*/
-public class TermDtoLabelProvider extends StyledCellLabelProvider {
+public class TermDtoLabelProvider extends StyledCellLabelProvider implements ILabelProvider{
private static Color vocColor = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
private static Color kindOfColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
private Styler vocStyler;
private Styler kindOfStyler;
+ protected boolean showIdInVoc = false;
public TermDtoLabelProvider() {
+ showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS, true);
}
public TermDtoLabelProvider(Styler vocStyler){
this.vocStyler = vocStyler;
+ showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS, true);
}
@Override
public void update(ViewerCell cell) {
Object element = cell.getElement();
- boolean showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS, true);
- String text = getText(element, showIdInVoc);
+// boolean showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS, true);
+ String text = getText(element);
cell.setText(text);
Styler styler = null;
super.update(cell);
}
- public String getText(Object element, boolean showIdInVocabulary) {
+ @Override
+ public String getText(Object element) {
String label = null;
if(element instanceof AbstractTermDto){
AbstractTermDto termDto = (AbstractTermDto)element;
termDto.localize(new TermRepresentation_L10n());
label = termDto.getRepresentation_L10n();
- if(showIdInVocabulary && element instanceof TermDto && ((TermDto) termDto).getIdInVocabulary()!=null){
+ if(showIdInVoc && element instanceof TermDto && ((TermDto) termDto).getIdInVocabulary()!=null){
label = CdmUtils.concat(" : ", ((TermDto) termDto).getIdInVocabulary(), label);
}
}
return kindOfStyler;
}
+ @Override
+ public Image getImage(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContextListener {
public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor"; //$NON-NLS-1$
+ private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
protected TreeViewer viewer;
private MDirtyable dirty;
private ISelectionChangedListener selectionChangedListener;
- private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
private TermEditorInput input =null;
return true;
}
- public void init(TermEditorInput input){
+ public void init(TermEditorInput input, String label){
this.input = input;
viewer.setInput(input.getVocabularies());
- thisPart.setLabel(input.getName());
+ thisPart.setLabel(label);
}
@Override
getConversationHolder().commit();
for(TermBase term:changedTerms){
if(term.isInstanceOf(DefinedTermBase.class)){
- DefinedTermBase definedTermBase = (DefinedTermBase) term;
+ DefinedTermBase<?> definedTermBase = (DefinedTermBase<?>) term;
CdmStore.getService(ITermService.class).merge(definedTermBase);
}
else if(term.isInstanceOf(TermVocabulary.class)){
- TermVocabulary voc = (TermVocabulary) term;
+ TermVocabulary<?> voc = (TermVocabulary<?>) term;
CdmStore.getService(IVocabularyService.class).merge(voc);
}
}
@Override
public void changed(Object element) {
if(element instanceof DefinedTermBase){
- DefinedTermBase definedTermBase = (DefinedTermBase) element;
+ DefinedTermBase<?> definedTermBase = (DefinedTermBase<?>) element;
TermDto termDto = TermDto.fromTerm(definedTermBase);
viewer.update(termDto, null);
changedTerms.add(definedTermBase);
contentProvider.removeVocabularyFromCache(termDto.getVocabularyDto());
}
else if(element instanceof TermVocabulary){
- TermVocabulary vocabulary = (TermVocabulary)element;
+ TermVocabulary<?> vocabulary = (TermVocabulary<?>)element;
TermVocabularyDto vocabularyDto = new TermVocabularyDto(vocabulary.getUuid(), vocabulary.getRepresentations(), vocabulary.getTermType(), vocabulary.getTitleCache(), vocabulary.isAllowDuplicates(), vocabulary.isOrderRelevant(), vocabulary.isFlat());
viewer.update(vocabularyDto, null);
changedTerms.add(vocabulary);
@Override
public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
}
-
-}
+}
\ No newline at end of file
* 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.definedterm.e4.handler;
import java.util.List;
import java.util.stream.Collectors;
/**
- *
* @author pplitzner
* @since Aug 22, 2017
- *
*/
public class OpenDefinedTermEditorHandlerE4 {
//
// TermType termType = TermType.getByUuid(termTypeUuid);
if(termType != null){
- TermType type = termType;
- TermEditorInput termEditorInput = new TermEditorInput(termType);
- List<MPart> alreadyOpenedEditors = partService.getParts().stream()
- .filter(part->part.getObject()!=null && part.getObject() instanceof DefinedTermEditorE4)
- .filter(part->((DefinedTermEditorE4)part.getObject()).getDefinedTermEditorInput().getTermType().equals(type))
- .collect(Collectors.toList());
- if(!alreadyOpenedEditors.isEmpty()){
- //there should never be more than one already opened editor
- //so we just open the first
- partService.activate(alreadyOpenedEditors.iterator().next());
- }
- else{
- MPart part = partService.createPart(eu.etaxonomy.taxeditor.store.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DEFINEDTERM);
- MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
- if(editorAreaPartStack!=null){
- editorAreaPartStack.getChildren().add(part);
- }
- part = partService.showPart(part, PartState.ACTIVATE);
- DefinedTermEditorE4 termEditor = (DefinedTermEditorE4) part.getObject();
- termEditor.init(termEditorInput);
- }
+ TermType type = termType;
+ TermEditorInput termEditorInput = new TermEditorInput(termType);
+ List<MPart> alreadyOpenedEditors = partService.getParts().stream()
+ .filter(part->part.getObject()!=null && part.getObject() instanceof DefinedTermEditorE4)
+ .filter(part->((DefinedTermEditorE4)part.getObject()).getDefinedTermEditorInput().getTermType().equals(type))
+ .collect(Collectors.toList());
+ if(!alreadyOpenedEditors.isEmpty()){
+ //there should never be more than one already opened editor
+ //so we just open the first
+ partService.activate(alreadyOpenedEditors.iterator().next());
+ }
+ else{
+ MPart part = partService.createPart(eu.etaxonomy.taxeditor.store.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DEFINEDTERM);
+ MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
+ if(editorAreaPartStack!=null){
+ editorAreaPartStack.getChildren().add(part);
+ }
+ part = partService.showPart(part, PartState.ACTIVATE);
+ DefinedTermEditorE4 termEditor = (DefinedTermEditorE4) part.getObject();
+ termEditor.init(termEditorInput, menuItem.getLocalizedLabel());
+ }
}
}
-
-}
+}
\ No newline at end of file
\r
import eu.etaxonomy.cdm.api.service.ITermService;\r
import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;\r
import eu.etaxonomy.cdm.persistence.dto.TermDto;\r
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;\r
/**\r
* @author l.morris\r
* @date 21 Dec 2011\r
- *\r
*/\r
-public class CreateDefinedTermOperation extends AbstractPostOperation {\r
+public class CreateDefinedTermOperation extends AbstractPostOperation<DefinedTermBase> {\r
\r
private final AbstractTermDto parent;\r
private final TermEditorInput definedTermInput;\r
else if(parent instanceof TermVocabularyDto){\r
newTerm = CdmStore.getService(IVocabularyService.class).addNewTerm(definedTermInput.getTermType(), parent.getUuid());\r
}\r
+// newTerm.setTitleCache("_" + newTerm.getTitleCache());\r
return postExecute(newTerm);\r
}\r
\r
public static final String ADD_SAVE_CANDIDATE = "ADD/SAVE/CANDIDATE";
public static final String ADD_SAVE_CHARACTER = "ADD/SAVE/CHARACTER";
+ public static final String ADD_TO_MERGE_ROWS = "ADD/TO/MERGE/ROWS";
+
public static final String UPDATE_LINK_WITH_TAXON = "UPDATE/LINK_WITH_TAXON";
}
* 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.featuretree;
import java.util.HashMap;
*
* @author n.hoffmann
* @created Aug 5, 2010
- * @version 1.0
*/
public class TermTreeContentProvider<T extends DefinedTermBase> implements ITreeContentProvider {
- Viewer viewer;
- TermNodeDto oldInput;
- TermNodeDto newInput;
- Map<UUID, TermNodeDto> uuidTermMap = new HashMap<>();
+ private Viewer viewer;
+ private TermNodeDto oldInput;
+ private TermNodeDto newInput;
+ private Map<UUID, TermNodeDto> uuidTermMap = new HashMap<>();
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- /** {@inheritDoc} */
@Override
- public void dispose() {
-
- }
+ public void dispose() {}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- /** {@inheritDoc} */
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
this.viewer = viewer;
if (newInput instanceof TermTreeDto){
this.newInput = ((TermTreeDto)newInput).getRoot();
}
-
}
- /** {@inheritDoc} */
@Override
public Object[] getElements(Object inputElement) {
return this.getChildren(inputElement);
}
- /** {@inheritDoc} */
@Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof TermTree){
- List<TermNode> children = ((TermTree) parentElement).getRootChildren();
+ List<TermNode<?>> children = ((TermTree) parentElement).getRootChildren();
return children.toArray();
}else if(parentElement instanceof TermNode){
- List<TermNode> children = ((TermNode) parentElement).getChildNodes();
+ List<TermNode<?>> children = ((TermNode) parentElement).getChildNodes();
return children.toArray();
}
if(parentElement instanceof TermTreeDto){
}
}
- /** {@inheritDoc} */
@Override
public Object getParent(Object element) {
if(element instanceof TermNode){
- return ((TermNode) element).getParent();
+ return ((TermNode<?>) element).getParent();
}
if(element instanceof TermNodeDto){
TermNodeDto parent = uuidTermMap.get(((TermNodeDto) element).getParentUuid());
this.uuidTermMap = uuidTermMap;
}
-
- /** {@inheritDoc} */
@Override
public boolean hasChildren(Object element) {
return getChildren(element).length != 0;
}
-
-
-}
+}
\ No newline at end of file
* 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.featuretree;
import java.util.ArrayList;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
/**
- *
* @author n.hoffmann
* @created Aug 5, 2010
- * @version 1.0
*/
-public class TermTreeLabelProvider extends TermDtoLabelProvider{
+public class TermTreeLabelProvider extends TermDtoLabelProvider {
+
+ public TermTreeLabelProvider() {
+ showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS_IN_TREE_EDITOR, true);
+ }
+
- /** {@inheritDoc} */
@Override
- public String getText(Object element, boolean showIdInVoc) {
+ public String getText(Object element) {
if(element instanceof TermTreeDto){
return ((TermTreeDto) element).getRepresentation_L10n() != null? ((TermTreeDto) element).getRepresentation_L10n() :((TermTreeDto) element).getTitleCache() ;
}else if(element instanceof TermNodeDto){
TermDto term = ((TermNodeDto) element).getTerm();
if(term!=null){
- showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS_IN_TREE_EDITOR, true);
- return super.getText(term, showIdInVoc);
+// boolean showIdInVoc = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS_IN_TREE_EDITOR, true);
+ return super.getText(term);
}
}else if(element instanceof TermNode){
- DefinedTermBase term = ((TermNode) element).getTerm();
+ DefinedTermBase<?> term = ((TermNode<?>) element).getTerm();
if(term!=null){
Representation rep = term.getRepresentation(PreferencesUtil.getGlobalLanguage());
if (rep == null){
}
}else if(element instanceof TermTree){
- return ((TermTree) element).getTitleCache();
+ return ((TermTree<?>) element).getTitleCache();
}
return "No label provided";
}
-
-}
+}
\ No newline at end of file
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MHandledMenuItem menuItem,
EModelService modelService, EPartService partService, MApplication application,
- IEclipseContext context) {
+ IEclipseContext context) throws Exception {
this.context = context;
this.modelService = modelService;
this.application = application;
// protected abstract T getEntity(UUID uuid);
- protected abstract void open(T entity, Shell shell, EPartService partService);
+ protected abstract void open(T entity, Shell shell, EPartService partService) throws Exception;
protected abstract boolean canExecute(Object entity);
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MHandledMenuItem menuItem,
EModelService modelService, EPartService partService, MApplication application,
- IEclipseContext context) {
+ IEclipseContext context) throws Exception {
this.context = context;
this.modelService = modelService;
this.application = application;
WizardDialog dialog = new WizardDialog(shell, taxonNodeWizard);
int result = dialog.open();
if (result == Window.OK){
- EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, entity);
+// entity = CdmStore.getService(ITaxonNodeService.class).dto(entity.getUuid());
+ entity = new TaxonNodeDto(taxonNodeWizard.getEntity());
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, taxonNodeWizard.getEntity().getParent());
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, entity.getTaxonUuid());
}
public static String PresenceAbsenceTermDetailElement_CHOOSE_COLOR;
public static String PresenceAbsenceTermDetailElement_COLOR_NOT_SET;
public static String PresenceAbsenceTermDetailElement_LABEL_COLOR;
+ public static String PresenceAbsenceTermDetailElement_LABEL_IS_ABSENT;
public static String PreservationMethodMenuPreferences_select;
DebugPreferences_0=Show up widget is disposed error messages
DebugPreferences_1=Disable services api timestamp check
-DefaultFeatureTreePreferenecs_0=Default Feature Tree to be used for textual descriptions
+DefaultFeatureTreePreferenecs_0=Default Feature Tree to be used for natural language descriptions
DefaultFeatureTreePreferenecs_1=Default Feature Tree to be used for structured descriptions
DefinedTermEditorE4_SAVE_MESSAGE=You have made changes that must be saved before this query can be executed. Would you like to save?
PresenceAbsenceMenuPreferences_choose=Choose available distribution states
PresenceAbsenceTermDetailElement_CHOOSE_COLOR=Choose color
PresenceAbsenceTermDetailElement_COLOR_NOT_SET=Color could not be set
-PresenceAbsenceTermDetailElement_LABEL_COLOR=Color
+PresenceAbsenceTermDetailElement_LABEL_COLOR=Color
+PresenceAbsenceTermDetailElement_LABEL_IS_ABSENT=Absent
PreservationMethodMenuPreferences_select=Choose available preservation methods
DeleteConfiguration_media_removeFromGallery=Remove the media from the image gallery but leave it in database
CdmLightPreference_distributionString=Export of condensed distribution string
CdmLightPreference_distributionString_tooltip=Distributions of a taxon are exported as condensed string, created by the selected algorithm.
-SecundumPreference_description=Default settings of secundum reference handling for move synonym to accepted taxon.
+SecundumPreference_description=Default settings of secundum reference handling for change synonym to taxon and changing an taxon to synonym.
Tree= Tree
\ No newline at end of file
DebugPreferences_0=\"Widget is disposed\" Fehler Meldungen anzeigen
DebugPreferences_1=Deaktiviere die Überprüfung des API Timestamp
-DefaultFeatureTreePreferenecs_0=Default Merkmalsbaum für textuelle Faktendaten
-DefaultFeatureTreePreferenecs_1=Default Merkmalsbaum für strukturelle Faktendaten
+DefaultFeatureTreePreferenecs_0=Standard Merkmalsbaum für für natürlichsprachige Beschreibungen
+DefaultFeatureTreePreferenecs_1=Standard Merkmalsbaum für strukturelle Faktendaten
DefinedTermEditorE4_SAVE_MESSAGE=Sie haben Änderungen, die gespeichert werden müssen, bevor die Operation ausgeführt werden kann. Möchten Sie speichern?
DefinedTermEditorE4_SAVE_TITLE=Änderungen speichern
PresenceAbsenceTermDetailElement_CHOOSE_COLOR=Farbe wählen
PresenceAbsenceTermDetailElement_COLOR_NOT_SET=Farbe konnte nicht gespeichert werden
PresenceAbsenceTermDetailElement_LABEL_COLOR=Farbe
+PresenceAbsenceTermDetailElement_LABEL_IS_ABSENT=Abwesend
PreservationMethodMenuPreferences_select=Auswahl der zur Verf\u00FCgung stehenden Präservierungsmethoden
-DeleteConfiguration_media_removeFromGallery=Entferne Mediendaten aus der Gallerie, aber behalte es in der Datenbank
+DeleteConfiguration_media_removeFromGallery=Entferne Mediendaten aus der Gallerie, aber behalte sie in der Datenbank
DeleteConfiguration_media_deleteIfUsedInTaxonDescription=Lösche die Mediendaten, auch wenn sie Teil einer Taxonbeschreibung ist
DeleteConfiguration_media_deleteIfUsedSomeWhereElse=Lösche die Mediendaten vollständig, auch wenn sie an anderer Stelle verwendet werden
DeleteConfiguration_media_delete=Entferne die Mediendaten aus der Gallerie und lösche sie aus der Datenbank, wenn sie nicht anderweitig verwendet werden.
CdmLightPreference_distributionString=Export eines Condensed Distribution Strings
CdmLightPreference_distributionString_tooltip=Für jedes Taxon wird aus den Verbreitungsdaten ein kompakter String exportiert, der entsprechend dem ausgewählten Algorithmus erzeugt wird.
-SecundumPreference_description=Default Einstellungen für das Setzen der Secundum Referenz beim Verschieben eines Synonyms zu einem akzeptierten Taxon.
+SecundumPreference_description=Default Einstellungen für das Setzen der Secundum Referenz beim Ändern eines Synonyms in ein Taxon und anders herum.
Tree=-Baum
\ No newline at end of file
//colors1 and 2 are computed as next neutral color from the combined color
//light colors are computed as second last color tints
//see https://htmlcolorcodes.com/color-picker/
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1, 241,146,18);
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_LIGHT, 251, 228, 196);
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT2, 241, 202, 18);
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT2_LIGHT, 251, 242, 196);
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_2, 241, 90, 18);
- registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_2_LIGHT, 251, 214, 196);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1, 241,156,18);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_LIGHT, 251, 230, 196);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT2, 241, 190, 18);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT2_LIGHT, 251, 239, 196);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_2, 241, 140, 18);
+ registerColor(registry, Resources.COLOR_COMPOSITE_IRRELEVANT1_2_LIGHT, 251, 226, 196);
registerColor(registry, Resources.SEARCH_VIEW_FOREGROUND, 192, 192, 192);
registerColor(registry, Resources.SEARCH_VIEW_FOCUS, 0, 0, 0);
}
message = message + "\n" ; //$NON-NLS-1$
String stackTraceWithContext = getContextInfo(details);
- CdmDeleteErrorDialog ced = new CdmDeleteErrorDialog(AbstractUtility.getShell(), title, message,new Status(IStatus.INFO, pluginId, relatedObjectsString.toString(), result.getExceptions().iterator().next()), stackTraceWithContext, result.getUpdatedObjects().toArray());
+ CdmDeleteErrorDialog ced = new CdmDeleteErrorDialog(AbstractUtility.getShell(), title, message,new Status(IStatus.INFO, pluginId, relatedObjectsString.toString(), result.getExceptions() != null? result.getExceptions().iterator().next(): null), stackTraceWithContext, result.getUpdatedObjects().toArray());
ced.open();
}
public AbstractPostOperation(String label, UUID elementUuid, IUndoContext undoContext,
IPostOperationEnabled postOperationEnabled,
- ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+ ICdmEntitySessionEnabled<T> cdmEntitySessionEnabled) {
super(label);
addContext(undoContext);
this.element = null;
*/
@Override
public void widgetSelected(SelectionEvent e) {
- if (e.getSource().equals(useLocalOrAdmin)){
+ if (e.getSource().equals(useLocalOrAdmin)&& !isAdminPreference){
if (useLocalOrAdmin.getText().equals(LocalOrDefaultEnum.Default.getLabel())){
treeComposite.setEnabled(false);
isOverride = false;
if (!PreferencesUtil.getOverrideForPreference(preferencePredicate.getKey()) || !get(key).isAllowOverride()){
//get terms for the uuids... and add them to the termManager as preferred terms
Collection<TermDto> dtos = createDtoList(key);
- CdmStore.getTermManager().setPreferredTermsByType(dtos, termType);
+ if (dtos != null){
+ CdmStore.getTermManager().setPreferredTermsByType(dtos, termType);
+ }
}
}
}
import eu.etaxonomy.cdm.model.term.TermTree;
import eu.etaxonomy.taxeditor.featuretree.TermTreeContentProvider;
import eu.etaxonomy.taxeditor.featuretree.TermTreeLabelProvider;
-import eu.etaxonomy.taxeditor.featuretree.TermTreeContentProvider;
-import eu.etaxonomy.taxeditor.featuretree.TermTreeLabelProvider;
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
if(!CdmStore.isActive()) {
MessagingUtils.noDataSourceWarningDialog(null);
}else{
- createTextTreeSelection(composite);
createStructureTreeSelection(composite);
+ createTextTreeSelection(composite);
}
return composite;
final CLabel label = new CLabel(parent, SWT.NONE);
label.setText(Messages.DefaultFeatureTreePreferenecs_0);
- final ListViewer viewer = new ListViewer(parent);
+ final ListViewer viewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
viewer.setContentProvider(new TermTreeContentProvider());
@Override
public void selectionChanged(SelectionChangedEvent arg0) {
setApply(true);
+// viewer.setSelection(arg0.getSelection());
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
defaultFeatureTreeForTextualDescription = (TermTree)selection.getFirstElement();
+
}
});
final CLabel label = new CLabel(parent, SWT.NONE);
label.setText(Messages.DefaultFeatureTreePreferenecs_1);
- final ListViewer viewer = new ListViewer(parent);
+ final ListViewer viewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+
viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
viewer.setContentProvider(new TermTreeContentProvider());
@Override
public void selectionChanged(SelectionChangedEvent arg0) {
setApply(true);
+// viewer.setSelection(arg0.getSelection());
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
defaultFeatureTreeForStructuredDescription = (TermTree) selection.getFirstElement();
+
}
});
import eu.etaxonomy.cdm.model.metadata.IPreferencePredicate;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
import eu.etaxonomy.cdm.model.metadata.TermDisplayEnum;
import eu.etaxonomy.cdm.model.metadata.TermOrder;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
public static String getPreferenceValue(PrefKey prefKey){
try {
+ //check if there exist a node for the predicate
if(getEditorPreferences().nodeExists(prefKey.getPredicate())){
Preferences predicateNode = getEditorPreferences().node(prefKey.getPredicate());
String[] splittedSubject = extractSubjectParts(prefKey.getSubject());
+ //check if the predicate node contains a node for the subject, this should be the last part
String value = predicateNode.get(splittedSubject[splittedSubject.length-1], PreferencePredicate.getByKey(prefKey.getPredicate()).getDefaultValue() != null? PreferencePredicate.getByKey(prefKey.getPredicate()).getDefaultValue().toString(): "");
int index = splittedSubject.length -2;
while (value != null && index >= 0){
if (result instanceof String){
return (String)result;
}else{
- return result.toString();
+ return result != null?result.toString(): null;
}
}
return pref.getValue();
CdmPreferenceCache cache = CdmPreferenceCache.instance();
cache.getAllTaxEditorDBPreferences();
- //ABCD Configurator
-
- //updateAbcdImportConfigurationPreference();
-
//Name Details
NameDetailsConfigurator config = getPreferredNameDetailsConfiguration(false);
- // if (config != null ){
- // if (!getBooleanValue(OVERRIDE_NAME_DETAILS) || !getBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS)){
- // setPreferredNameDetailsConfiguration(config, false);
- // }
- // }
}
//TODO: needs to be adapted!!!
return false;
}
+
+ public static SecReferenceHandlingEnum getSecReferenceHandlingPreference(){
+ String defaultBehaviour = getStringValue(PreferencePredicate.DefaultBehaviourForSecundum.getKey());
+ SecReferenceHandlingEnum handling = SecReferenceHandlingEnum.valueOf(defaultBehaviour);
+ return handling;
+
+ }
}
--- /dev/null
+/**
+* Copyright (C) 2020 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.preference;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
+import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
+
+/**
+ * @author k.luther
+ * @since Dec 1, 2020
+ */
+public class SecundumReferenceHandling extends CdmPreferencePage {
+
+ protected SecReferenceHandlingEnum secundumBehaviour;
+
+ protected Combo synonymSecundumBehaviour;
+ protected CdmPreference pref = null;
+ Button allowOverrideButton;
+
+ protected boolean allowOverride;
+ private boolean override = true;
+
+
+ @Override
+ public void init() {
+ super.init();
+
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ getValues();
+
+ Composite composite = createComposite(parent);
+
+ if (!allowOverride && !isAdminPreference){
+ final CLabel description = new CLabel(composite, SWT.NULL);
+ description.setText(Messages.PublishFlagPreference_description_not_allowed);
+ description.setLayoutData(createTextGridData());
+ return composite;
+ }
+
+ synonymSecundumBehaviour = createCombo(composite, SecReferenceHandlingEnum.values(), PreferencePredicate.DefaultBehaviourForSecundum, Messages.SecundumPreference_description, isAdminPreference);
+ synonymSecundumBehaviour.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setApply(true);
+ if (!synonymSecundumBehaviour.getText().startsWith(Messages.Preference_Use_Default)){
+ secundumBehaviour = (SecReferenceHandlingEnum)synonymSecundumBehaviour.getData(synonymSecundumBehaviour.getText());
+ }else{
+ secundumBehaviour = null;
+ }
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ if (this.isAdminPreference){
+ allowOverrideButton = createAllowOverrideButton(composite);
+ allowOverrideButton.setSelection(allowOverride);
+ allowOverrideButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ allowOverride = !allowOverride;
+ setApply(true);
+ }
+ });
+ }
+ int index = 0;
+
+ if(secundumBehaviour==null){
+ synonymSecundumBehaviour.select(0);
+ }
+ else{
+ for (String itemLabel : synonymSecundumBehaviour.getItems()){
+ if (itemLabel.startsWith(secundumBehaviour.getLabel())){
+ synonymSecundumBehaviour.select(index);
+ break;
+ }
+ index++;
+ }
+ }
+
+ return composite;
+
+ }
+
+
+ @Override
+ public boolean performOk() {
+ if (isApply()){
+ if (secundumBehaviour != null){
+ String text = synonymSecundumBehaviour.getText();
+ for (SecReferenceHandlingEnum display: SecReferenceHandlingEnum.values()){
+ if (text.startsWith(display.getLabel())){
+ text = display.getKey();
+ break;
+ }
+ }
+ PreferencesUtil.setStringValue(PreferencePredicate.DefaultBehaviourForSecundum.getKey(), text);
+ if (pref == null || !pref.getValue().equals(text)){
+ PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.DefaultBehaviourForSecundum.getKey()), true);
+ }
+ }else{
+ PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.DefaultBehaviourForSecundum.getKey()), false);
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void getValues(){
+ secundumBehaviour = null;
+ PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewInstance("/MoveSynToAccepted/"), PreferencePredicate.DefaultBehaviourForSecundum);
+ pref = PreferencesUtil.getPreferenceFromDB(key);
+ if (pref == null){
+ pref = CdmPreference.NewInstance(key, PreferencePredicate.DefaultBehaviourForSecundum.getDefaultValue().toString());
+ }
+ allowOverride = pref.isAllowOverride();
+ try{
+ String secundumString = PreferencesUtil.getStringValue(PreferencePredicate.DefaultBehaviourForSecundum.getKey(), true);
+
+ if (secundumString != null){
+ secundumBehaviour = SecReferenceHandlingEnum.valueOf(secundumString);
+ }
+ }catch (IllegalArgumentException e){
+ secundumBehaviour = SecReferenceHandlingEnum.KeepWhenSame;
+ }
+ String prefString = PreferencesUtil.prefOverrideKey(PreferencePredicate.DefaultBehaviourForSecundum.getKey());
+ override = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.DefaultBehaviourForSecundum.getKey()), true);
+ if (!override){
+ secundumBehaviour = null;
+ }
+ }
+
+ @Override
+ protected void performDefaults() {
+ secundumBehaviour = null;
+ allowOverride = true;
+ int index = 0;
+
+ for (String itemLabel : synonymSecundumBehaviour.getItems()){
+ if (itemLabel.startsWith(Messages.Preference_Use_Default)){
+ synonymSecundumBehaviour.select(index);
+ break;
+ }
+ index++;
+ }
+ if (isAdminPreference){
+ allowOverrideButton.setSelection(allowOverride);
+ }
+ setApply(true);
+ super.performDefaults();
+ }
+
+
+
+
+
+}
--- /dev/null
+/**
+* Copyright (C) 2021 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.preference.wizard;
+
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.widgets.Tree;
+
+/**
+ * @author k.luther
+ * @since Feb 11, 2021
+ */
+public class CdmCheckBoxTreeViewer extends CheckboxTreeViewer {
+
+ /**
+ * @param tree
+ */
+ public CdmCheckBoxTreeViewer(Tree tree) {
+ super(tree);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected void handleTreeExpand(TreeEvent event) {
+
+ super.handleTreeExpand(event);
+ if (((CheckBoxTreeComposite)this.getControl().getParent()).checkedElements != null){
+ this.setCheckedElements(((CheckBoxTreeComposite)this.getControl().getParent()).checkedElements);
+ }
+
+ }
+
+}
private Button btnSelectAllChildren;
private Button btnSelectDirectChildren;
+ protected Object[] checkedElements;
+
private boolean allowTopLevelSelection = false;
public CheckBoxTreeComposite(Composite parent, ITreeContentProvider contentProvider, IBaseLabelProvider labelProvider, int style) {
item.setChecked(false);
return;
}
+
+ if (item.getChecked()){
+ if (checkedElements != null){
+ Object[] tempArray = Arrays.copyOf(checkedElements, checkedElements.length +1);
+ tempArray[checkedElements.length] = item.getData();
+ checkedElements = tempArray;
+ }
+
+ }else{
+ int index = 0;
+ for (Object o:checkedElements){
+ if (o != null && o.equals(item.getData())){
+ break;
+ }
+ index ++;
+
+ }
+ checkedElements[index] = null;
+ }
+
updateItem(item);
}
});
- viewer = new CheckboxTreeViewer(tree);
+ viewer = new CdmCheckBoxTreeViewer(tree);
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(labelProvider);
+
}
int checkedCount = 0;
for (TreeItem child : children) {
updateChildItems(child);
- if(child.getChecked()){
+
+ if(child.getChecked() ){
if ((child.getFont().equals(FONT_BOLD)) || (child.getItems().length == 0)) {
checkedCount++;
}
* @param elements
*/
public void setCheckedElements(Object[] elements) {
+
+ this.checkedElements = elements;
viewer.setCheckedElements(elements);
- for (Object element: elements) {
+ for (Object element: checkedElements) {
viewer.reveal(element);
}
TreeItem[] rootItems = viewer.getTree().getItems();
while(parent!=null && !(parent instanceof ScrolledForm) && !parent.isDisposed()){
parent = parent.getParent();
}
- scrolledForm = (ScrolledForm)parent;
+ if (parent instanceof ScrolledForm){
+ scrolledForm = (ScrolledForm)parent;
+ }else if ( parent != null && !parent.isDisposed() && parent.getParent() != null && !parent.getParent().isDisposed() &&parent.getParent() instanceof ScrolledForm ){
+ scrolledForm = (ScrolledForm)parent.getParent();
+ }
+
if(scrolledForm!=null){
if (!scrolledForm.isDisposed()){
scrolledForm.reflow(flushCashes);
/**
* @author k.luther
* @since 15.10.2018
- *
*/
public class InverseTermWrapper {
- String label;
- NameRelationshipType term;
- boolean isInverse;
+ private String label;
+ private NameRelationshipType term;
+ boolean isInverse;
boolean useAbbrevLabel;
}
}
-
public NameRelationshipType getTerm() {
return term;
}
-
-
public void setTerm(NameRelationshipType term) {
this.term = term;
}
-
public String getLabel() {
return label;
}
-
-
public void setLabel(String label) {
this.label = label;
}
public boolean isInverse() {
return isInverse;
}
-
-
public void setInverse(boolean isInverse) {
this.isInverse = isInverse;
}
- /**
- * @param term
- * @return
- */
private String getInverseLabel(NameRelationshipType term) {
if (term == null){
return "";
languages.add(CdmStore.getDefaultLanguage());
Representation rep = term.getPreferredInverseRepresentation(languages);
- if (useAbbrevLabel){
- termLabel = rep.getAbbreviatedLabel();
- if (termLabel == null){
+ if (rep != null){
+ if (useAbbrevLabel){
+ termLabel = rep.getAbbreviatedLabel();
+ if (termLabel == null){
+ termLabel = rep.getLabel();
+ }
+ }else{
termLabel = rep.getLabel();
}
-
- }else{
- termLabel = rep.getLabel();
}
if (termLabel == null){
termLabel = term.getInverseLabel();
return termLabel;
}
-
}
/**
}else{
String termLabel = null;
Representation rep = term.getPreferredRepresentation(CdmStore.getDefaultLanguage());
- if (useAbbrevLabel){
- termLabel = rep.getAbbreviatedLabel();
- if (termLabel == null){
+ if (rep != null){
+ if (useAbbrevLabel){
+ termLabel = rep.getAbbreviatedLabel();
+ if (termLabel == null){
+ termLabel = rep.getLabel();
+ }
+ }else{
termLabel = rep.getLabel();
}
- }else{
- termLabel = rep.getLabel();
}
if (termLabel == null){
termLabel = term.getLabel();
return termLabel;
}
}
-
-}
+}
\ No newline at end of file
classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
for(Classification tree : classifications){
- classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree));
+ classificationSelectionCombo.add(tree.getTitleCache(), classifications.indexOf(tree));
if (tree.getUuid().equals(selectedUuid)){
selectedClassification = tree;
}
*/
package eu.etaxonomy.taxeditor.ui.section.media;
-import java.util.Map;
-
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionListener;
-import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.agent.AgentBase;
-import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.common.TimePeriod;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
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.element.ISelectableElement;
-import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
public class MediaMetaElement extends AbstractEntityCollectionElement<Media> implements ISelectableElement, ITogglableMediaElement{
private EntitySelectionElement<AgentBase> selection_artist;
- private LanguageStringWithLabelElement text_description;
- private LanguageStringWithLabelElement text_title;
+ private MultilanguageTextElement text_description;
+ private MultilanguageTextElement text_title;
private MediaDetailElement mediaDetailElement;
private TimePeriodElement mediaCreated;
private SelectionArbitrator selectionArbitrator;
// }
// });
setWarnForReferencingObjects(element, 2);
- text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
+ text_title = formFactory.createMultiLanguageTextElement(element, "Title", null, 50, style);
+// text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
selection_artist = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
element, "Artist", null, EntitySelectionElement.ALL, style);
addElement(selection_artist);
mediaCreated = formFactory.createTimePeriodElement(element, "Media Created", getEntity().getMediaCreated(), style);
addElement(mediaCreated);
- text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
+ text_description = formFactory.createMultiLanguageTextElement(this, "Description", null, 200, SWT.WRAP);
mediaDetailElement = formFactory.createMediaDetailElement(element);
selection_artist.setEntity(HibernateProxyHelper
.deproxy(element.getArtist()));
- text_description.setLanguageString(element.getDescription(CdmStore
- .getDefaultLanguage()));
- if (CdmUtils.isBlank(text_description.getText())){
- Map<Language, LanguageString> allDescriptions = element.getAllDescriptions();
- if (!allDescriptions.isEmpty()){
- text_description.setLanguageString(allDescriptions.get(Language.ENGLISH()));
- }
- }
+ text_description.setMultilanguageText(element.getAllDescriptions());
+// if (CdmUtils.isBlank(text_description.getText())){
+// Map<Language, LanguageString> allDescriptions = element.getAllDescriptions();
+// if (!allDescriptions.isEmpty()){
+// text_description.setLanguageString(allDescriptions.get(Language.ENGLISH()));
+// }
+// }
createTitle();
}
public void createTitle() {
- LanguageString title = this.entity.getTitle(CdmStore.getDefaultLanguage());
-
- if (title == null) {
- title = LanguageString.NewInstance(entity.getTitleCache(), CdmStore.getDefaultLanguage());
- }
+// LanguageString title = this.entity.getTitle(CdmStore.getDefaultLanguage());
+//
+// if (title == null) {
+// title = LanguageString.NewInstance(entity.getTitleCache(), CdmStore.getDefaultLanguage());
+// }
- text_title.setLanguageString(title);
+ text_title.setMultilanguageText(entity.getAllTitles());
}
@Override
if (eventSource == selection_artist) {
getEntity().setArtist(selection_artist.getSelection());
} else if (eventSource == text_description) {
- getEntity().addDescription(text_description.getLanguageString());
+ text_description.getMultilanguageText().values()
+ .forEach(languageString -> getEntity().addDescription(languageString));
} else if (eventSource == text_title) {
- getEntity().putTitle(text_title.getLanguageString());
+ text_title.getMultilanguageText().values()
+ .forEach(languageString -> getEntity().putTitle(languageString));
if (getParentElement() instanceof AbstractCdmDetailSection) {
((AbstractCdmDetailSection<?>) getParentElement()).updateTitle();
}
AbstractFormSection formElement,
NameRelationship entity, SelectionListener removeListener, int style){
super(cdmFormFactory, formElement, entity, removeListener, "Source", style);
- setSourceLabel("Source");
+
}
@Override
spacer.getLayoutComposite().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addElement(spacer);
super.createControls(element, style);
+ setSourceLabel("Source");
}
@Override
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.agent.AgentBase;
-import eu.etaxonomy.cdm.model.term.TermType;
import eu.etaxonomy.cdm.model.media.Rights;
import eu.etaxonomy.cdm.model.media.RightsType;
+import eu.etaxonomy.cdm.model.term.TermType;
import eu.etaxonomy.taxeditor.ui.combo.term.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.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
private TermComboElement<RightsType> combo_rightsType;
private EntitySelectionElement<AgentBase> selection_agent;
private TextWithLabelElement text;
+ private TextWithLabelElement abbrev;
+ private UriWithLabelElement uri;
/**
* <p>
null, EntitySelectionElement.ALL, style);
text = formFactory.createMultiLineTextWithLabel(this, "Text", 100,
style);
+ abbrev = formFactory.createTextWithLabelElement(element, "Abbrev. Text", null, style);
+
+ uri = formFactory.createUriWithLabelElement(element, "Uri", null, style);
+
}
/*
combo_rightsType.setSelection(element.getType());
selection_agent.setEntity(element.getAgent());
text.setText(element.getText());
+ abbrev.setText(element.getAbbreviatedText());
+ uri.setParsedText(element.getUri());
}
/*
entity.setAgent(selection_agent.getSelection());
} else if (eventSource == text) {
entity.setText(text.getText());
- }
+ }else if (eventSource == abbrev) {
+ entity.setAbbreviatedText(abbrev.getText());
+ }else if (eventSource == uri) {
+ entity.setUri(uri.parseText());
+ }
+
}
}
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.TableWrapData;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.taxeditor.l10n.Messages;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.ImageResources;
private Button btnColorChooser;
+ private Label isAbsentLabel;
+
+ private Button btnIsAbsent;
+
public PresenceAbsenceTermDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
btnColorChooser.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
btnColorChooser.setToolTipText(Messages.PresenceAbsenceTermDetailElement_CHOOSE_COLOR);
btnColorChooser.addSelectionListener(this);
+
+ Label isAbsentTextLabel = new Label(getLayoutComposite(), style);
+ isAbsentTextLabel.setText(Messages.PresenceAbsenceTermDetailElement_LABEL_IS_ABSENT);
+ left = LayoutConstants.LEFT();
+ left.valign = TableWrapData.MIDDLE;
+ isAbsentTextLabel.setLayoutData(left);
+ addControl(isAbsentTextLabel);
+
+ btnIsAbsent = formFactory.createButton(getLayoutComposite(), "", SWT.CHECK); //$NON-NLS-1$
+ btnIsAbsent.addSelectionListener(this);
+ btnIsAbsent.setSelection(getEntity().isAbsenceTerm());
}
@Override
*/
@Override
public void widgetSelected(SelectionEvent e) {
- ColorDialog dialog = new ColorDialog(AbstractUtility.getShell());
- if(color!=null){
- dialog.setRGB(color.getRGB());
- }
- RGB rgb = dialog.open();
- if(rgb!=null){
+ if (e.getSource().equals(btnColorChooser)){
+ ColorDialog dialog = new ColorDialog(AbstractUtility.getShell());
if(color!=null){
- color.dispose();
+ dialog.setRGB(color.getRGB());
}
- color = new Color(AbstractUtility.getShell().getDisplay(), rgb);
- colorLabel.setBackground(color);
- try {
- String hexCode = String.format("%02x%02x%02x", rgb.red,rgb.green,rgb.blue); //$NON-NLS-1$
- getEntity().setDefaultColor(hexCode);
- } catch (ParseException pe) {
- MessagingUtils.error(PresenceAbsenceTermDetailElement.class, Messages.PresenceAbsenceTermDetailElement_COLOR_NOT_SET, pe);
+ RGB rgb = dialog.open();
+ if(rgb!=null){
+ if(color!=null){
+ color.dispose();
+ }
+ color = new Color(AbstractUtility.getShell().getDisplay(), rgb);
+ colorLabel.setBackground(color);
+ try {
+ String hexCode = String.format("%02x%02x%02x", rgb.red,rgb.green,rgb.blue); //$NON-NLS-1$
+ getEntity().setDefaultColor(hexCode);
+ } catch (ParseException pe) {
+ MessagingUtils.error(PresenceAbsenceTermDetailElement.class, Messages.PresenceAbsenceTermDetailElement_COLOR_NOT_SET, pe);
+ }
}
+ }else if (e.getSource().equals(btnIsAbsent)){
+ getEntity().setAbsenceTerm(btnIsAbsent.getSelection());
}
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
}
setText("Inspect Active Session");
cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
activeSession = CdmStore.getCurrentSessionManager().getActiveSession();
- //TODO
- ecdr = activeSession.debug(false);
+ if (activeSession != null){
+ //TODO
+ ecdr = activeSession.debug(false);
+ }
}
/**
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:tx="http://www.springframework.org/schema/tx"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">\r
-\r
- <!-- Local application context and term initializer -->\r
- <import resource="classpath:/eu/etaxonomy/cdm/localApplicationContext.xml"/>\r
- \r
- <!-- Remote application context and term initializer -->\r
- <!-- <import resource="classpath:/eu/etaxonomy/cdm/remotingApplicationContext.xml"/> -->\r
- \r
-</beans>\r
Bundle-ManifestVersion: 2
Bundle-Name: eu.etaxonomy.taxeditor.test
Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<artifactId>eu.etaxonomy.taxeditor.test</artifactId>
<!-- for packaging=eclipse-test-plugin
/**
* @author cmathew
* @date 3 Feb 2015
- *
*/
@DataSet
Taxon taxon = taxonNode.getTaxon();
TaxonDescription description = TaxonDescription.NewInstance(taxon);
-
TextData textData = TextData.NewInstance();
-
textData.setFeature(Feature.ECOLOGY());
description.addElement(textData);
DescriptionElementSource descriptionElementSource = DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
textData.addSource(descriptionElementSource);
-
CdmStore.getService(ITaxonNodeService.class).merge(taxonNode);
description.getId();
}
-
@Test
public void addTaxonNodeCascadeProblem() {
UUID taxonNodeUuid = UUID.fromString("ce54c396-3694-47f2-abb0-1d7b7e057985");
TaxonNode taxonNode = taxonNodeService.load(taxonNodeUuid);
Taxon childTaxon = Taxon.NewInstance(null, null);
TaxonNode childTaxonNode = taxonNode.addChildTaxon(childTaxon, null, null);
+ CdmStore.getService(ITaxonNodeService.class).merge(childTaxonNode, true);
+
Taxon grandChildTaxon = Taxon.NewInstance(null, null);
TaxonNode grandChildTaxonNode = childTaxonNode.addChildTaxon(grandChildTaxon, null, null);
- CdmStore.getService(ITaxonNodeService.class).merge(grandChildTaxonNode,true);
+ CdmStore.getService(ITaxonNodeService.class).merge(grandChildTaxonNode, true);
Assert.assertEquals(taxonNode.getChildNodes().get(0).getId(), childTaxonNode.getId());
Assert.assertFalse(grandChildTaxon.getId() == 0);
Assert.assertEquals(taxonNode.getChildNodes().get(0).getChildNodes().get(0).getTaxon().getId(), grandChildTaxon.getId());
}
-
-}
-
+}
\ No newline at end of file
operation = new RemotingChangeAcceptedTaxonToSynonymOperation(sessionOwner,
false,
oldTaxonNode.getUuid(),
- newAcceptedTaxonNode.getUuid(), true);
+ newAcceptedTaxonNode.getUuid(), null, null, true);
operation.execute(monitor, info);
newAcceptedTaxonNode = taxonNodeService.load(newAcceptedTaxonNodeUuid);
oldTaxonNode = taxonNodeService.load(oldTaxonNodeNodeUuid);
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+ http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+ http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
eu.etaxonomy.taxeditor.workbench.datasource,
eu.etaxonomy.taxeditor.workbench.part
Bundle-Name: Workbench Bundle
-Bundle-Version: 5.20.0
+Bundle-Version: 5.21.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.e4.ui.workbench,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="5.20.0">
+<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="5.21.0">
<aboutInfo>
<image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
<text>
<programArgsLin>--launcher.GTK_version
2
</programArgsLin>
- <vmArgs>-Xmx512M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow
+ <vmArgs>-Xmx512M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow -Dremoting.httpinvoker.measureDuration=true
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
</prerequisites>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>5.20.0</version>
+ <version>5.21.0</version>
<name>EDIT Taxonomic Editor</name>
<description>The Taxonomic Editor for EDIT's platform for
cybertaxonomy
<properties>
<java.codelevel>1.8</java.codelevel>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <cdmlib.version>5.20.0</cdmlib.version>
+ <cdmlib.version>5.21.0</cdmlib.version>
<!-- TODO can we use project.version ????? -->
<!-- Increasing tycho above 0.22.0 will fail for the macosx build because
for higher version numbers tycho needs to be build against Eclipse Mars or
higher -->
<tycho.version>1.0.0</tycho.version>
- <taxeditor.version>5.20.0</taxeditor.version>
+ <taxeditor.version>5.21.0</taxeditor.version>
<update.dir>snapshot</update.dir>
<log4j.version>1.2.17</log4j.version>
<httpcomponents.version>4.5.12</httpcomponents.version>