#4242 delete MA
authorKatja Luther <k.luther@bgbm.org>
Wed, 4 Jun 2014 12:09:23 +0000 (12:09 +0000)
committerKatja Luther <k.luther@bgbm.org>
Wed, 4 Jun 2014 12:09:23 +0000 (12:09 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java

index fb4856897d7e0a285ea50ef51518498a43b7e4cc..97850acbbfb547d933a4e4eca69828ea4e7e390b 100644 (file)
@@ -15,12 +15,16 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>DeleteMisapplicationOperation class.</p>
@@ -73,6 +77,14 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation {
 
                // Remove misapplied name relation from taxon
                element.removeTaxon(misapplication, TaxonRelationshipType.MISAPPLIED_NAME_FOR());
+               ICdmApplicationConfiguration controller;
+
+               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
+
+               ITaxonService service = controller.getTaxonService();
+               TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+               
+               service.deleteTaxon(misapplication, config, null);
                monitor.worked(40);
 
                return postExecute(null);