fix #6088: remove the session from the nameRelationSection fixes the multiple repres...
authorKatja Luther <k.luther@bgbm.org>
Mon, 27 Mar 2017 11:55:40 +0000 (13:55 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 27 Mar 2017 11:55:40 +0000 (13:55 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipWizard.java

index de86f8d568eaa2137c043ba2ed3f40200b7301ac..1e28b62af92ffbfa29d1b97847291e4ea9cfc07b 100644 (file)
@@ -1,19 +1,14 @@
 /**
 * 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.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.name;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
 import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -22,8 +17,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>NameRelationshipWizard class.</p>
@@ -32,14 +25,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class NameRelationshipWizard extends Wizard implements IConversationEnabled, ICdmEntitySessionEnabled{
+public class NameRelationshipWizard extends Wizard implements IConversationEnabled{
 
        private static NameRelationshipDetailSection callingSection;
-       
-       private ICdmEntitySession cdmEntitySession;
+
+       //private ICdmEntitySession cdmEntitySession;
     private ICdmEntitySession previousCdmEntitySession;
     private CdmBase rootElement;
-       
+
        /**
         * <p>Constructor for NameRelationshipWizard.</p>
         *
@@ -48,23 +41,18 @@ public class NameRelationshipWizard extends Wizard implements IConversationEnabl
        public NameRelationshipWizard(NameRelationshipDetailSection callingSection) {
                NameRelationshipWizard.callingSection = callingSection;
                rootElement = callingSection.getEntity();
-               if (CdmStore.isActive()) {
-            previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
-            cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
-            cdmEntitySession.bind();
-        }
        }
-               
+
        private NameRelationshipWizardPage page;
 
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               page = new NameRelationshipWizardPage(callingSection); 
-               
+               page = new NameRelationshipWizardPage(callingSection);
+
                addPage(page);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
@@ -77,12 +65,7 @@ public class NameRelationshipWizard extends Wizard implements IConversationEnabl
        @Override
     public void dispose() {
         super.dispose();
-        if(cdmEntitySession != null) {
-            cdmEntitySession.dispose();
-        }
-        if(previousCdmEntitySession!=null){
-            previousCdmEntitySession.bind();
-        }
+
     }
 
        /**
@@ -99,25 +82,14 @@ public class NameRelationshipWizard extends Wizard implements IConversationEnabl
         *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return callingSection.getConversationHolder();
        }
 
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {}
-
-        @Override
-           public ICdmEntitySession getCdmEntitySession() {
-               return cdmEntitySession;
-           }
-
-           @Override
-           public java.util.Collection<CdmBase> getRootEntities() {
-               return Collections.singleton(rootElement);
-           }
-
-           @Override
-           public Map<Object, List<String>> getPropertyPathsMap() {
-               return null;
-           }
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {}
+
+
 }