Cleaning up ProtologueSection #5638
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / newWizard / NewPersonWizard.java
index 2268713342c95ad21c1e9d7dfa0cb52514c1ee9d..ab5f7038d644a9df499ff241b833b0d777147968 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -29,7 +29,7 @@ public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
        public void addPages() {
                addPage(new PersonWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected Person createNewEntity() {
@@ -39,6 +39,15 @@ public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(IAgentService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(IAgentService.class).save(getEntity());
+           }
+       }
+
+       @Override
+       protected String getEntityName() {
+               return "Person";
        }
 }