Project

General

Profile

Revision 22c3ad8e

ID22c3ad8e916b0be63b0f6610410a605f5010e0bf
Parent d1388918
Child 3810ffb7

Added by Katja Luther about 3 years ago

use monitored service method for setSecundumForSubTree

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/SetSecReferenceForSubtreeHandler.java
18 18
import org.eclipse.jface.wizard.WizardDialog;
19 19
import org.eclipse.ui.handlers.HandlerUtil;
20 20

  
21
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
21
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
22 22
import eu.etaxonomy.cdm.model.taxon.Classification;
23 23
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
24 24
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
25
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
25 26
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
26 27
import eu.etaxonomy.taxeditor.navigation.navigator.operation.SetSecundumForSubtreeOperation;
27 28
import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
......
89 90

  
90 91
           configurator = new SetSecundumForSubtreeConfigurator(taxonNode.getUuid());
91 92
           SetSecundumForSubtreeConfigurationWizard wizard = new SetSecundumForSubtreeConfigurationWizard(configurator);
93
           wizard.setWindowTitle(Messages.SetSecundumForSubtreeHandler_CONFIG_DIALOG_TITLE);
92 94

  
93 95
           WizardDialog dialog = new WizardDialog(StoreUtil.getShell(), wizard);
94 96

  
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/SetSecundumForSubtreeOperation.java
20 20
import org.eclipse.swt.widgets.Display;
21 21
import org.eclipse.ui.progress.IProgressConstants;
22 22

  
23
import eu.etaxonomy.cdm.api.application.CdmApplicationException;
23 24
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
24 25
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
26
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
27
import eu.etaxonomy.cdm.api.service.ITaxonService;
25 28
import eu.etaxonomy.cdm.api.service.UpdateResult;
26 29
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
27
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
30
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
28 31
import eu.etaxonomy.cdm.io.service.IIOService;
29 32
import eu.etaxonomy.taxeditor.model.AbstractUtility;
33
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
30 34
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
31 35
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
32 36
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
......
88 92

  
89 93
            @Override
90 94
            protected IStatus run(IProgressMonitor monitor) {
91
                                  IIOService ioService = CdmApplicationState.getIOService();
92
                   final UUID uuid = ioService.monitUpdateData(config);
93
                   Display.getDefault().asyncExec(new Runnable() {
94
                       @Override
95
                       public void run() {
96
                           AbstractUtility.executeMoniteredOperation("Update: " + config.getClass().getSimpleName(),
97
                                   uuid,
98
                                   1000,
99
                                   false,
100
                                   SetSecundumForSubtreeOperation.this,
101
                                   null);
102
                       }
103
                   });
104
                   return Status.OK_STATUS;
95
                   
96
            	try {
97
            		eu.etaxonomy.cdm.common.monitor.IProgressMonitor cdmMonitor =  CdmProgressMonitorAdapter.CreateMonitor(monitor);
98
					ITaxonNodeService taxonService = CdmApplicationState.getService(ITaxonNodeService.class);
99
//					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
	            	});
112
            	} catch (CdmApplicationException e) {
113
					// TODO Auto-generated catch block
114
					e.printStackTrace();
115
				}
116
//            	
117
            	return Status.OK_STATUS;
105 118

  
106 119
            }
107 120
        };
108
            return job;
109
        }
121
        return job;
122
    }
110 123

  
111 124

  
112 125

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/SetSecundumConfiguratorWizardPage.java
26 26
import org.eclipse.swt.widgets.Text;
27 27
import org.eclipse.wb.swt.ResourceManager;
28 28

  
29
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
29
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
30 30
import eu.etaxonomy.cdm.model.reference.Reference;
31 31
import eu.etaxonomy.taxeditor.l10n.Messages;
32 32
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/SetSecundumForSubtreeConfigurationWizard.java
12 12
import org.eclipse.swt.SWT;
13 13
import org.eclipse.swt.widgets.Shell;
14 14

  
15
import eu.etaxonomy.cdm.io.common.SetSecundumForSubtreeConfigurator;
15
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
16 16
import eu.etaxonomy.cdm.model.reference.Reference;
17 17

  
18 18
/**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)