Merge branch 'release/3.12.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / newWizard / NewCollectionWizard.java
index d28f0ec5d6ddf22aebde5d18e77193ed517b6ba5..8efc02f8cfa1f4db1f0fad5c2ea5e4b80353e2b3 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,14 +29,18 @@ public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
        public void addPages() {
                addPage(new CollectionWizardPage(formFactory, getConversationHolder(), getEntity()));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
        /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
-               CdmStore.getService(ICollectionService.class).saveOrUpdate(getEntity());
+           if(CdmStore.getCurrentSessionManager().isRemoting()) {
+               CdmStore.getService(ICollectionService.class).merge(getEntity(), true);
+           } else {
+               CdmStore.getService(ICollectionService.class).save(getEntity());
+           }
        }
 
        /* (non-Javadoc)
@@ -52,5 +56,5 @@ public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
        protected String getEntityName() {
                return "Collection";
        }
-       
+
 }