minor
authorKatja Luther <k.luther@bgbm.org>
Thu, 13 Oct 2016 11:15:53 +0000 (13:15 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 13 Oct 2016 11:15:53 +0000 (13:15 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java

index 5ea635f3b156e82c05d07745a4264d00b44f7f21..4d2a7257cdc53a00fefc590180671e14b13b04c7 100644 (file)
@@ -6,9 +6,12 @@ import java.util.List;
 import java.util.UUID;\r
 \r
 import eu.etaxonomy.cdm.api.service.ITaxonService;\r
+import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;\r
 import eu.etaxonomy.cdm.api.service.config.FindTaxaAndNamesConfiguratorImpl;\r
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;\r
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;\r
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;\r
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;\r
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
 import eu.etaxonomy.cdm.model.taxon.Synonym;\r
@@ -79,9 +82,10 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
        /** {@inheritDoc} */\r
        @Override\r
        public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {\r
-               IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<TaxonBase>();\r
-               newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized());\r
-               newConfig.setMatchMode(MatchMode.ANYWHERE);\r
+//             IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<TaxonBase>();\r
+//             newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized());\r
+//             newConfig.setMatchMode(MatchMode.ANYWHERE);\r
+               \r
                List<TaxonBase> taxa =  CdmStore.getSearchManager().findTaxa(configurator);\r
                List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>();\r
                for (TaxonBase taxon:taxa){\r
@@ -107,8 +111,26 @@ public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{
        /** {@inheritDoc}\r
         * @throws ReferencedObjectUndeletableException */\r
        @Override\r
-    public boolean delete(TaxonBase entity) {\r
-               return CdmStore.getService(ITaxonService.class).delete(entity) != null;\r
+    public boolean delete(TaxonBase entity, DeleteConfiguratorBase config) {\r
+               if (entity instanceof Taxon){\r
+                       TaxonDeletionConfigurator taxonConfig = null;\r
+                       if (config instanceof TaxonDeletionConfigurator){\r
+                               taxonConfig = (TaxonDeletionConfigurator)config;\r
+                       }else{\r
+                               \r
+                       }\r
+                       \r
+                       return CdmStore.getService(ITaxonService.class).deleteTaxon(entity.getUuid(), taxonConfig, null) != null;\r
+               } else{\r
+                       SynonymDeletionConfigurator synConfig = null;\r
+                       if (config instanceof SynonymDeletionConfigurator){\r
+                               synConfig = (SynonymDeletionConfigurator)config;\r
+                       }else{\r
+                               \r
+                       }\r
+                       \r
+                       return CdmStore.getService(ITaxonService.class).deleteSynonym(entity.getUuid(), synConfig) != null;\r
+               }\r
        }\r
        @Override\r
        protected IEntityCreator<TaxonBase> createEntityCreator() {\r