Project

General

Profile

Revision 50600204

ID506002044386715e6d37d7f36f1b10ab33df8b76
Parent d0eb8b9f
Child ae37df1c

Added by Katja Luther about 4 years ago

setSecundum for subtree throws Exception with monitor, as workaround remove monitor

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetSecReferenceForSubtreeHandlerE4.java
23 23
import org.eclipse.jface.wizard.WizardDialog;
24 24
import org.eclipse.swt.widgets.Shell;
25 25

  
26
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
26
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
27 27
import eu.etaxonomy.cdm.model.taxon.Classification;
28 28
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
29 29
import eu.etaxonomy.taxeditor.model.AbstractUtility;
......
41 41
public class SetSecReferenceForSubtreeHandlerE4 extends RemotingCdmHandlerE4 {
42 42

  
43 43
    private ITaxonTreeNode taxonNode;
44
    private SetSecundumForSubtreeConfigurator configurator;
44
    private SecundumForSubtreeConfigurator configurator;
45 45

  
46 46
    public SetSecReferenceForSubtreeHandlerE4() {
47 47
        super(TaxonNavigatorLabels.CHANGE_SECUNDUM_FOR_SUBTREE);
......
86 86
        //                       TaxonNavigatorLabels.RELATED_EDITOR_NOT_CLOSED_MESSAGE);
87 87
        //           }
88 88

  
89
        configurator = new SetSecundumForSubtreeConfigurator(taxonNode.getUuid());
89
        configurator = new SecundumForSubtreeConfigurator(taxonNode.getUuid());
90 90
        SetSecundumForSubtreeConfigurationWizard wizard = new SetSecundumForSubtreeConfigurationWizard(configurator);
91 91

  
92 92
        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(), wizard);
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetSecundumForSubtreeOperation.java
24 24
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
25 25
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
26 26
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
27
import eu.etaxonomy.cdm.api.service.ITaxonService;
28 27
import eu.etaxonomy.cdm.api.service.UpdateResult;
28
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
29 29
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
30
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
31
import eu.etaxonomy.cdm.io.service.IIOService;
32
import eu.etaxonomy.taxeditor.model.AbstractUtility;
33
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
34 30
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
35 31
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
36 32
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
......
46 42
    private static final Logger logger = Logger
47 43
            .getLogger(SetSecundumForSubtreeOperation.class);
48 44
    UUID parentUuid;
49
    SetSecundumForSubtreeConfigurator config;
45
    SecundumForSubtreeConfigurator config;
50 46
    UpdateResult updateResult = new UpdateResult();
51 47

  
52 48
    /**
......
58 54
    public SetSecundumForSubtreeOperation(Object source,
59 55
            boolean async,
60 56
            UUID taxonNodeUuid,
61
            SetSecundumForSubtreeConfigurator config) {
57
            SecundumForSubtreeConfigurator config) {
62 58
        super(LABEL, Action.Update, source, async);
63 59
        parentUuid = taxonNodeUuid;
64 60
        this.config = config;
......
92 88

  
93 89
            @Override
94 90
            protected IStatus run(IProgressMonitor monitor) {
95
                   
91

  
96 92
            	try {
97
            		eu.etaxonomy.cdm.common.monitor.IProgressMonitor cdmMonitor =  CdmProgressMonitorAdapter.CreateMonitor(monitor);
93
//            		eu.etaxonomy.cdm.common.monitor.IProgressMonitor cdmMonitor =  CdmProgressMonitorAdapter.CreateMonitor(monitor);
94
//            		config.setMonitor(cdmMonitor);
98 95
					ITaxonNodeService taxonService = CdmApplicationState.getService(ITaxonNodeService.class);
99 96
//					taxonService.setSecundumForSubtree(config.getSubtreeUuid(), config.getNewSecundum(), config.isIncludeAcceptedTaxa(), config.isIncludeSynonyms(), config.isOverwriteExistingAccepted(), config.isOverwriteExistingSynonyms(), config.isIncludeSharedTaxa(), config.isEmptySecundumDetail(), null);
100
					final UUID uuid = taxonService.monitSetSecundum(config);
101
					Display.getDefault().asyncExec(new Runnable() {
102
	                   @Override
103
	                   public void run() {
104
	                       AbstractUtility.executeMoniteredOperation("Update: " + config.getClass().getSimpleName(),
105
	                               uuid,
106
	                               1000,
107
	                               false,
108
	                               SetSecundumForSubtreeOperation.this,
109
	                               null);
110
	                   }
111
	            	});
97
					updateResult = taxonService.setSecundumForSubtree(config);
98

  
99
//					Display.getDefault().asyncExec(new Runnable() {
100
//	                   @Override
101
//	                   public void run() {
102
//	                       AbstractUtility.executeMoniteredOperation("Update: " + config.getClass().getSimpleName(),
103
//	                               uuid,
104
//	                               1000,
105
//	                               false,
106
//	                               SetSecundumForSubtreeOperation.this,
107
//	                               null);
108
//	                   }
109
//	            	});
110

  
112 111
            	} catch (CdmApplicationException e) {
113 112
					// TODO Auto-generated catch block
114 113
					e.printStackTrace();
115 114
				}
116
//            	
115
//
117 116
            	return Status.OK_STATUS;
118 117

  
119 118
            }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)