1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.taxeditor.store.operations;
|
12
|
|
13
|
import org.apache.log4j.Logger;
|
14
|
import org.eclipse.core.commands.operations.IUndoContext;
|
15
|
import org.eclipse.core.runtime.IStatus;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
|
18
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
19
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
20
|
|
21
|
/**
|
22
|
* @author n.hoffmann
|
23
|
* @created 08.05.2009
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public abstract class AbstractPersistentPostOperation extends AbstractPostOperation {
|
27
|
private static final Logger logger = Logger
|
28
|
.getLogger(AbstractPersistentPostOperation.class);
|
29
|
private IConversationEnabled conversationEnabled;
|
30
|
|
31
|
/**
|
32
|
* @param label
|
33
|
* @param undoContext
|
34
|
* @param taxon
|
35
|
* @param postOperationEnabled
|
36
|
*/
|
37
|
public AbstractPersistentPostOperation(String label,
|
38
|
IUndoContext undoContext, Taxon taxon,
|
39
|
IPostOperationEnabled postOperationEnabled) {
|
40
|
super(label, undoContext, taxon, postOperationEnabled);
|
41
|
// TODO Auto-generated constructor stub
|
42
|
}
|
43
|
|
44
|
public AbstractPersistentPostOperation(String label,
|
45
|
IUndoContext undoContext, Taxon taxon,
|
46
|
IPostOperationEnabled postOperationEnabled,
|
47
|
IConversationEnabled conversationEnabled) {
|
48
|
super(label, undoContext, taxon, postOperationEnabled);
|
49
|
|
50
|
this.conversationEnabled = conversationEnabled;
|
51
|
}
|
52
|
|
53
|
protected IStatus postExecute(CdmBase objectAffectedByOperation) {
|
54
|
IStatus status = super.postExecute(objectAffectedByOperation);
|
55
|
|
56
|
if(conversationEnabled != null){
|
57
|
conversationEnabled.getConversationHolder().commit(true);
|
58
|
}
|
59
|
|
60
|
return status;
|
61
|
}
|
62
|
|
63
|
}
|