Project

General

Profile

« Previous | Next » 

Revision daaa3a02

Added by Katja Luther about 4 years ago

fix regression in setSubtree Operations

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
144 144
        	if(part.getObject() instanceof TaxonNameEditorE4
145 145
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
146 146
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(input.getTaxon().getUuid())){
147
        	    if (part.isDirty()){
148
        	        forceUserSaveE4Editor(((TaxonNameEditorE4) part.getObject()), getShell());
149
        	    }
147 150
                partService.hidePart(part);
148 151
                break;
149 152
            }
......
326 329
                TaxonNode node = taxonEditor.getEditorInput().getTaxonNode();
327 330
                if (node.treeIndex()!= null){
328 331
	                if(node.treeIndex().startsWith(treeIndex)){
332
	                    if (part.isDirty()){
333
	                        forceUserSaveE4Editor(taxonEditor, getShell());
334
	                    }
329 335
	                    partService.hidePart(part);
330 336
	                }
331 337
                }else{
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetPublishForSubtreeOperation.java
25 25
import org.eclipse.swt.widgets.Display;
26 26
import org.eclipse.ui.progress.IProgressConstants;
27 27

  
28
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
28 29
import eu.etaxonomy.cdm.api.service.UpdateResult;
29 30
import eu.etaxonomy.cdm.api.service.config.PublishForSubtreeConfigurator;
30 31
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
32
import eu.etaxonomy.taxeditor.store.CdmStore;
31 33

  
32 34
/**
33 35
 * @author k.luther
......
79 81
        Assert.isNotNull(config, "Configuration may not be null");
80 82

  
81 83
        final Display display = Display.getDefault();
82

  
84
        taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
83 85
        Job job = new Job(Messages.SetPublishFlagForSubtreeOperation_SET_SEC_TASK) {
84 86

  
85 87

  
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetSecundumForSubtreeOperation.java
25 25
import org.eclipse.e4.ui.workbench.modeling.EModelService;
26 26
import org.eclipse.e4.ui.workbench.modeling.EPartService;
27 27
import org.eclipse.swt.widgets.Display;
28
import org.eclipse.ui.progress.IProgressConstants;
29 28

  
30
import eu.etaxonomy.cdm.api.application.CdmApplicationException;
31
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
32 29
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
33 30
import eu.etaxonomy.cdm.api.service.UpdateResult;
34 31
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
......
64 61
    @Override
65 62
    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
66 63
//        runMoniteredOperation();
67

  
68
        Job job = createJob(monitor);
69
        // configure the job
70
        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
71
        job.setUser(true);
72
        // schedule job
73
        job.schedule();
64
        runMoniteredOperation();
65
        updateNameEditors();
66
//        Job job = createJob(monitor);
67
//        // configure the job
68
//        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
69
//        job.setUser(true);
70
//        // schedule job
71
//        job.schedule();
74 72

  
75 73
        return updateResult;
76 74

  
......
102 100

  
103 101
    public void runMoniteredOperation() {
104 102
        ITaxonNodeService nodeService;
105
        try {
106
            nodeService = CdmApplicationState.getService(ITaxonNodeService.class);
107

  
108
            final UUID uuid = nodeService.monitSetSecundum((SecundumForSubtreeConfigurator)config);
109
            Display.getDefault().asyncExec(new Runnable() {
103
        final UUID uuid = longRunningTaskService.monitLongRunningTask((SecundumForSubtreeConfigurator)config);
104
        Display.getDefault().asyncExec(new Runnable() {
110 105
            @Override
111 106
            public void run() {
112 107
                AbstractUtility.executeMoniteredOperation("Set Secundum Reference for Subtree: ",
......
117 112
                        null);
118 113
            }
119 114
        });
120
        } catch (CdmApplicationException e) {
121
            // TODO Auto-generated catch block
122
            e.printStackTrace();
123
        }
115

  
124 116

  
125 117
    }
126 118

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
714 714
                        reportSb.append(((UpdateResult)remotingMonitor.getResult()).getExceptions().toString());
715 715
                    }
716 716
//	                    }
717
                    if(!StringUtils.isBlank(reportSb.toString())) {
717
                    if(!StringUtils.isBlank(reportSb.toString()) && reportSb.length() != 0) {
718 718
                        Display.getDefault().asyncExec(new Runnable() {
719 719
                            @Override
720 720
                            public void run() {

Also available in: Unified diff