-// $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.
*/
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
@Deprecated // we do not undo creation of elements
public class CreateClassification extends AbstractPersistentPostOperation {
- private Classification classification;
-
+ private final Classification classification;
+
/**
* <p>Constructor for SaveClassificationOperation.</p>
*
*/
public CreateClassification(String label, IUndoContext undoContext, Classification classification,
IPostOperationEnabled postOperationEnabled,
- IConversationEnabled conversationEnabled) {
- super(label, undoContext, postOperationEnabled, conversationEnabled);
-
+ IConversationEnabled conversationEnabled,
+ ICdmEntitySessionEnabled cdmEntitiySessionEnabled) {
+ super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitiySessionEnabled);
+
this.classification = classification;
-
+
}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
+
/** {@inheritDoc} */
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
bind();
monitor.worked(20);
-
+
if(classification.getReference() == null){
Reference reference = ReferenceFactory.newGeneric();
- reference.setTitleCache(classification.getTitleCache());
+ reference.setTitle(classification.getTitleCache());
classification.setReference(reference);
}
-
+
CdmStore.getService(IClassificationService.class).saveOrUpdate(classification);
-
+
monitor.worked(40);
return postExecute(classification);
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
/** {@inheritDoc} */
@Override
public IStatus redo(IProgressMonitor monitor, IAdaptable info)
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
/** {@inheritDoc} */
@Override
public IStatus undo(IProgressMonitor monitor, IAdaptable info)