MultiPageTaxonEditor : added cdm entity session capabilities to update and register...
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / MultiPageTaxonEditor.java
index 1d6ab76ef195043f5aed2c0eb9fb84aa6acad021..d1054f9598eb6a97aed9c663f1b0e541e78432c0 100644 (file)
@@ -79,6 +79,7 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
     public MultiPageTaxonEditor() {
         super();
         undoContext = new UndoContext();
+
     }
 
     /** {@inheritDoc} */
@@ -103,7 +104,7 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
         input = (TaxonEditorInput) getEditorInput();
         conversation = input.getConversationHolder();
         conversation.registerForDataStoreChanges(this);
-
+        cdmEntitySession.registerForDataStoreChanges(this);
         try {
             addPage(Page.NAME.getIndex(), new TaxonNameEditor(this),
                     getEditorInput());
@@ -147,6 +148,8 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
             }
 
             // commit the conversation and start a new transaction immediately
+
+            input.update();
             conversation.commit(true);
             monitor.worked(1);
 
@@ -169,6 +172,7 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
                 editorPage.setDisabled();
             }
         }
+        cdmEntitySession.unregisterForDataStoreChanges(this);
         conversation.unregisterForDataStoreChanges(this);
         conversation.close();
         setDirty(false);
@@ -251,6 +255,7 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
         }
 
         this.input = (TaxonEditorInput) input;
+        cdmEntitySession = this.input.getCdmEntitySession();
 
         // try {
         // // Listen for name changes,
@@ -561,7 +566,6 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
      */
     @Override
     public ICdmEntitySession getCdmEntitySession() {
-        // TODO Auto-generated method stub
-        return null;
+        return cdmEntitySession;
     }
 }