Revert last commit (taxon node handling is done in taxeditor)
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 8 Feb 2016 13:07:35 +0000 (14:07 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 8 Feb 2016 13:07:35 +0000 (14:07 +0100)
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java

index 5c7ef53e73e0573b46c505546b449cf715eb9e52..ff0128c6245603fe9a7205699e0b4bd5afd9dd74 100644 (file)
@@ -588,27 +588,15 @@ public class TaxonNodeServiceImpl extends AnnotatableServiceBase<TaxonNode, ITax
         UpdateResult result = new UpdateResult();
         TaxonNode parent = dao.load(parentNodeUuid);
         TaxonNode child = null;
-        if(parent!=null){
-            try{
-                child = parent.addChildTaxon(newTaxon, parent.getReference(), parent.getMicroReference());
-                dao.saveOrUpdate(parent);
-                result.addUpdatedObject(parent);
-            }catch(Exception e){
-                logger.error("TaxonNode could not be created.");
-            }
-        }
-        else{
-            //check if parent is a classification
-            Classification classification = classService.load(parentNodeUuid);
-            if(classification!=null){
-                child = classification.addChildTaxon(newTaxon, classification.getReference(), classification.getMicroReference());
-                classService.saveOrUpdate(classification);
-                result.addUpdatedObject(classification.getRootNode());
-            }
-
+        try{
+            child = parent.addChildTaxon(newTaxon, parent.getReference(), parent.getMicroReference());
+        }catch(Exception e){
+            logger.error("TaxonNode could not be created.");
         }
 //        child = dao.save(child);
 
+        dao.saveOrUpdate(parent);
+        result.addUpdatedObject(parent);
         result.setCdmEntity(child);
         return result;