fix for invisible description.setTaxon method in Editor
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 14 Feb 2014 17:19:20 +0000 (17:19 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 14 Feb 2014 17:19:20 +0000 (17:19 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionToOtherTaxonOperation.java

index d4eaf56fe115c0edeff600af6f580177bc0f79d1..e6fc72bf4cd79d390bbc05a5073a017574bae3b2 100644 (file)
@@ -19,13 +19,10 @@ import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
-import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
 import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.AnnotationType;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
-import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
@@ -81,12 +78,12 @@ public class MoveDescriptionToOtherTaxonOperation extends
                        if(!StringUtils.isBlank(description.getTitleCache())){
                                separator = " - ";
                        }
-                       description.setTitleCache(description.getTitleCache() + separator + moveMessage);
+                       description.setTitleCache(description.getTitleCache() + separator + moveMessage, true);
                }
                Annotation annotation = Annotation.NewInstance(moveMessage, Language.DEFAULT());
                annotation.setAnnotationType(AnnotationType.TECHNICAL());
                description.addAnnotation(annotation);
-               description.setTaxon(newAcceptedTaxonNode.getTaxon());
+               newAcceptedTaxonNode.getTaxon().addDescription(description);
                CdmStore.getService(IDescriptionService.class).saveOrUpdate(description);       
                monitor.worked(40);