Revision d175d20f
Added by Cherian Mathew almost 9 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java | ||
---|---|---|
21 | 21 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
22 | 22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
24 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
|
25 | 24 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
26 | 25 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
27 | 26 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
68 | 67 |
|
69 | 68 |
// Find misapplication relation, save citation information |
70 | 69 |
|
71 |
for (TaxonRelationship relationship : element.getTaxonRelations()) { |
|
72 |
if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR()) |
|
73 |
&& relationship.getFromTaxon().equals(misapplication)) { |
|
74 |
citation = relationship.getCitation(); |
|
75 |
microcitation = relationship.getCitationMicroReference(); |
|
76 |
} |
|
77 |
} |
|
70 |
// for (TaxonRelationship relationship : element.getTaxonRelations()) {
|
|
71 |
// if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())
|
|
72 |
// && relationship.getFromTaxon().equals(misapplication)) {
|
|
73 |
// citation = relationship.getCitation();
|
|
74 |
// microcitation = relationship.getCitationMicroReference();
|
|
75 |
// }
|
|
76 |
// }
|
|
78 | 77 |
monitor.worked(20); |
79 | 78 |
|
80 | 79 |
// Remove misapplied name relation from taxon |
81 | 80 |
element.removeTaxon(misapplication, TaxonRelationshipType.MISAPPLIED_NAME_FOR()); |
82 | 81 |
ICdmApplicationConfiguration controller; |
83 | 82 |
|
84 |
controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
|
|
83 |
controller = CdmStore.getCurrentApplicationConfiguration(); |
|
85 | 84 |
|
86 | 85 |
ITaxonService service = controller.getTaxonService(); |
87 | 86 |
TaxonDeletionConfigurator config = new TaxonDeletionConfigurator(); |
88 | 87 |
NameDeletionConfigurator nameConfig = new NameDeletionConfigurator(); |
89 | 88 |
nameConfig.setRemoveAllNameRelationships(true); |
90 | 89 |
config.setNameDeletionConfig(nameConfig); |
91 |
service.deleteTaxon(misapplication, config, null); |
|
90 |
service.deleteTaxon(misapplication.getUuid(), config, null);
|
|
92 | 91 |
monitor.worked(40); |
93 | 92 |
|
94 | 93 |
return postExecute(null); |
Also available in: Unified diff
added cdm entitysession enabled objects to operations