Project

General

Profile

« Previous | Next » 

Revision 8edb3fc3

Added by Patrick Plitzner about 5 years ago

ref #6952 Temporarily disallow deletion of non-empty vocabularies

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
8 8
*/
9 9
package eu.etaxonomy.taxeditor.editor.definedterm.operation;
10 10

  
11
import java.util.Collection;
12

  
11 13
import org.eclipse.core.commands.ExecutionException;
12 14
import org.eclipse.core.commands.operations.IUndoContext;
13 15
import org.eclipse.core.runtime.IAdaptable;
......
57 59
		if (termBase instanceof TermVocabularyDto) {
58 60
			definedEditorInput.getVocabularies().remove(termBase);
59 61

  
62
			// FIXME this is just a temporary fix for #6952
63
			Collection<TermDto> topLevelTerms = CdmStore.getService(IVocabularyService.class).getTopLevelTerms(termBase.getUuid());
64
			if(!topLevelTerms.isEmpty()){
65
			    MessagingUtils.warningDialog("Deletion not possible", this, "Deletion not possible. Vocabulary is not empty.\nPlease delete or move the child terms first");
66
			    return Status.CANCEL_STATUS;
67
			}
68

  
60 69
			DeleteResult result =	CdmStore.getService(IVocabularyService.class).delete(termBase.getUuid());
61 70
			if (!result.isOk()){
62 71
			    return showErrorMessage(result);

Also available in: Unified diff