private Map<TaxonBase, TaxonBaseDeletionConfigurator> toDeletes = new HashMap<>();
private Set<Synonym> toSaveNewSynonyms = new HashSet<>();
- private List<TaxonBase> toSaveNewConcepts = new ArrayList<>();
+ private List<TaxonBase> toSaveConcepts = new ArrayList<>();
private List<TaxonName> toSaveNewNames = new ArrayList<>();
-
private Set<AbstractPostOperation> operations = new HashSet<>();
private TaxonEditorInputDataChangeBehaviourE4 dataChangeBehavior;
public void addToSaveNewSynonym(Synonym toSaveNew) {
this.toSaveNewSynonyms.add(toSaveNew);
}
- public void addToSaveNewConcept(Taxon toSaveNew) {
- this.toSaveNewConcepts.add(toSaveNew);
-
+ public void addToSaveConcept(Taxon toSaveNew) {
+ this.toSaveConcepts.add(toSaveNew);
}
@Override
delete(entry.getKey(), entry.getValue());
}
toDeletes.clear();
- CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+
+ // new concepts needs to be saved separately, the list contains all concepts, the
+ for (TaxonBase<?> concept: toSaveConcepts){
+ if (concept != null){
+ if (concept.getName() != null){
+ for (HybridRelationship rel : concept.getName().getHybridChildRelations()){
+ toSaveNewNames.add(rel.getParentName());
+ toSaveNewNames.add(rel.getHybridName());
+ }
+ }
+ }
+ }
+
+ //handle cascading for hybrid relationshis
+ //accepted taxa
+ if (taxonNode.getTaxon().getName() != null){
+ for (HybridRelationship rel : taxonNode.getTaxon().getName().getHybridChildRelations()){
+ toSaveNewNames.add(rel.getParentName());
+ toSaveNewNames.add(rel.getHybridName());
+ }
+ }
+ //synonyms
+ for (TaxonName synonymName : taxonNode.getTaxon().getSynonymNames()){
+ if (synonymName != null){
+ for (HybridRelationship rel : synonymName.getHybridChildRelations()){
+ toSaveNewNames.add(rel.getParentName());
+ toSaveNewNames.add(rel.getHybridName());
+ }
+ }
+ }
+// for (TaxonName name:toSaveNewNames){
+// name.get
+// }
+
+ if (!toSaveNewNames.isEmpty()){
+ CdmStore.getService(INameService.class).merge(toSaveNewNames, true);
+ }
+ if (!toSaveConcepts.isEmpty()){
+ CdmStore.getService(ITaxonService.class).merge(toSaveConcepts, true);
+ }
+
+ toSaveNewNames.clear();
+ toSaveConcepts.clear();
+
for(AbstractPostOperation<?> entry:operations){
IStatus status = Status.CANCEL_STATUS;
final IAdaptable uiInfoAdapter = WorkspaceUndoUtil
entry.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
status = entry.execute(new NullProgressMonitor(), uiInfoAdapter);
} catch (ExecutionException e) {
-
MessagingUtils.operationDialog(AbstractUtility.class, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
-
}
- String statusString = status.equals(Status.OK_STATUS) ? "completed"
- : "cancelled";
-
IPostOperationEnabled postOperationEnabled = entry
.getPostOperationEnabled();
if (postOperationEnabled != null) {
postOperationEnabled.onComplete();
}
-
//AbstractUtility.executeOperation(entry,sync);
}
operations.clear();
- for (Synonym syn: toSaveNewSynonyms){
- for (HybridRelationship rel : syn.getName().getHybridChildRelations()){
-// if (!rel.getParentName().isPersited()) {
- toSaveNewNames.add(rel.getParentName());
-// }
-// if (!rel.getHybridName().isPersited()) {
- toSaveNewNames.add(rel.getHybridName());
-// }
-
- }
- }
-
- for (TaxonBase<?> concept: toSaveNewConcepts){
- for (HybridRelationship rel : concept.getName().getHybridChildRelations()){
-// if (!rel.getParentName().isPersited()) {
- toSaveNewNames.add(rel.getParentName());
-// }
-// if (!rel.getHybridName().isPersited()) {
- toSaveNewNames.add(rel.getHybridName());
-// }
-
- }
- }
- if (!toSaveNewNames.isEmpty()){
- CdmStore.getService(INameService.class).merge(toSaveNewNames, true);
- }
- if (!toSaveNewConcepts.isEmpty()){
- CdmStore.getService(ITaxonService.class).merge(toSaveNewConcepts, true);
- }
-
- toSaveNewNames.clear();
- toSaveNewConcepts.clear();
-
-
-
-
+ CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
}
private void delete(TaxonBase key, TaxonBaseDeletionConfigurator value) {
"extensions", //$NON-NLS-1$
"rights", //$NON-NLS-1$
"sources", //$NON-NLS-1$
+ "sources.links", //$NON-NLS-1$
"identifiers",
"descriptions", //$NON-NLS-1$
"taxonNodes", //$NON-NLS-1$
"descriptions.descriptionElements.feature", //$NON-NLS-1$
"descriptions.descriptionElements.area", //$NON-NLS-1$
"descriptions.descriptionElements.status", //$NON-NLS-1$
+ "descriptions.descriptionElements.markers", //$NON-NLS-1$
+ "descriptions.descriptionElements.sources", //$NON-NLS-1$
+ "descriptions.descriptionElements.annotations", //$NON-NLS-1$
"descriptions.markers", //$NON-NLS-1$
+ "descriptions.descriptionSources", //$NON-NLS-1$
+ "descriptions.sources", //$NON-NLS-1$
+ "descriptions.annotations", //$NON-NLS-1$
+ "descriptions.links", //$NON-NLS-1$
"name.descriptions", //$NON-NLS-1$
"name.typeDesignations.typeSpecimen.derivedFrom.originals", //$NON-NLS-1$
+ "name.typeDesignations.source", //$NON-NLS-1$
+ "name.typeDesignations.source.nameUsedInSource", //$NON-NLS-1$
+ "name.typeDesignations.source.citation", //$NON-NLS-1$
+ "name.typeDesignations.source.links", //$NON-NLS-1$
+ "name.typeDesignations.text", //$NON-NLS-1$
+ "name.typeDesignations.sources", //$NON-NLS-1$
+ "name.typeDesignations.sources.links", //$NON-NLS-1$
"name.status", //$NON-NLS-1$
- "name.nomenclaturalReference.inReference", //$NON-NLS-1$
+ "name.nomenclaturalSource", //$NON-NLS-1$
+ "name.nomenclaturalSource.nameUsedInSource", //$NON-NLS-1$
+ "name.nomenclaturalSource.links.description", //$NON-NLS-1$
+ "name.nomenclaturalSource.citation", //$NON-NLS-1$
+ "name.nomenclaturalSource.citation.inReference", //$NON-NLS-1$
+ "name.nomenclaturalSource.cdmSource", //$NON-NLS-1$
+ "name.nomenclaturalSource.cdmSource.description", //$NON-NLS-1$
+ "name.status.source", //$NON-NLS-1$
+ "name.status.source.links", //$NON-NLS-1$
"name.taxonBases.taxonNodes", //$NON-NLS-1$
"name.relationsFromThisName", //$NON-NLS-1$
+ "name.relationsFromThisName.source", //$NON-NLS-1$
+ "name.relationsFromThisName.source.links", //$NON-NLS-1$
"name.relationsToThisName", //$NON-NLS-1$
+ "name.relationsToThisName.source", //$NON-NLS-1$
+ "name.relationsToThisName.source.links", //$NON-NLS-1$
"name.homotypicalGroup.typifiedNames.taxonBases.synonyms.synonym.name.status", //$NON-NLS-1$
"name.homotypicalGroup.typifiedNames.relationsToThisName.fromName", //$NON-NLS-1$
+ "name.rank.vocabulary", //$NON-NLS-1$
"synonyms.name.status.type", //$NON-NLS-1$
- "synonyms.name.relationsToThisName.fromName", //$NON-NLS-1$
- "synonyms.name.nomenclaturalReference.inReference.authorship", //$NON-NLS-1$
- "synonyms.name.nomenclaturalReference.authorship", //$NON-NLS-1$
- "synonyms.name.homotypicalGroup.typifiedNames.taxonBases.synonyms" //$NON-NLS-1$
+ "synonyms.name.relationsToThisName.relatedFrom", //$NON-NLS-1$
+ "synonyms.name.relationsFromThisName.relatedTo", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.nameUsedInSource", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.links", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.citation", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.citation.inReference", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.cdmSource", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.cdmSource.description", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.citation.inReference.authorship", //$NON-NLS-1$
+ "synonyms.name.nomenclaturalSource.citation.authorship", //$NON-NLS-1$
+ "synonyms.name.homotypicalGroup.typifiedNames.taxonBases.synonyms", //$NON-NLS-1$
+ "relationsFromThisTaxon",//$NON-NLS-1$
+ "relationsToThisTaxon"//$NON-NLS-1$
+
});
return taxonBasePropertyPaths;
public void addToSaveNewName(TaxonName newName) {
this.toSaveNewNames.add(newName);
}
-}
+}
\ No newline at end of file