Revision 7c96f526
Added by Katja Luther about 3 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingChangeAcceptedTaxonToSynonymOperation.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
23 | 23 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
24 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
|
24 | 25 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
25 | 26 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
27 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
26 | 28 |
import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum; |
29 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
30 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
|
27 | 31 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
28 | 32 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
29 | 33 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
34 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
30 | 35 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
31 | 36 |
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation; |
32 | 37 |
|
... | ... | |
131 | 136 |
secHandling, |
132 | 137 |
setNameInSource);//TODO |
133 | 138 |
} |
139 |
boolean oldTaxaPublished = true; |
|
140 |
for (CdmBase delObject:((DeleteResult)updateResult).getDeletedObjects()){ |
|
141 |
if (delObject instanceof TaxonBase){ |
|
142 |
oldTaxaPublished &= ((TaxonBase)delObject).isPublish(); |
|
143 |
} |
|
144 |
} |
|
145 |
Taxon newTaxon = null; |
|
146 |
for (CdmBase updatedObject: updateResult.getUpdatedObjects()){ |
|
147 |
if (updatedObject instanceof Taxon){ |
|
148 |
for (TaxonNode node: ((Taxon)updatedObject).getTaxonNodes()){ |
|
149 |
if (node.getUuid().equals(newAcceptedTaxonNodeUuid)){ |
|
150 |
newTaxon = (Taxon)updatedObject; |
|
151 |
break; |
|
152 |
} |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
} |
|
157 |
if ( oldTaxaPublished != newTaxon.isPublish()){ |
|
158 |
MessagingUtils.warningDialog("Publish flag", null, Messages.RemotingChangeAcceptedTaxonToSynonym_warning_publish); |
|
159 |
} |
|
134 | 160 |
updateNameEditor(); |
135 | 161 |
return updateResult; |
136 | 162 |
|
Also available in: Unified diff
ref #8767: add warning dialog for change acc to syn for different puplish flags