67 |
67 |
|
68 |
68 |
private TaxonNode taxonNode;
|
69 |
69 |
|
70 |
|
private Map<TaxonBase, TaxonBaseDeletionConfigurator> toDelete = new HashMap<>();
|
71 |
|
private Set<Synonym> toSaveNewSynonym = new HashSet<>();
|
72 |
|
private Set<TaxonBase> toSaveNewConcept = new HashSet<>();
|
73 |
|
private Set<TaxonName> toSaveNewName = new HashSet<>();
|
|
70 |
private Map<TaxonBase, TaxonBaseDeletionConfigurator> toDeletes = new HashMap<>();
|
|
71 |
private Set<Synonym> toSaveNewSynonyms = new HashSet<>();
|
|
72 |
private Set<TaxonBase> toSaveNewConcepts = new HashSet<>();
|
|
73 |
private Set<TaxonName> toSaveNewNames = new HashSet<>();
|
74 |
74 |
|
75 |
75 |
|
76 |
76 |
private Set<AbstractPostTaxonOperation> operations = new HashSet<>();
|
... | ... | |
307 |
307 |
}
|
308 |
308 |
|
309 |
309 |
public void addToSaveNewSynonym(Synonym toSaveNew) {
|
310 |
|
this.toSaveNewSynonym.add(toSaveNew);
|
|
310 |
this.toSaveNewSynonyms.add(toSaveNew);
|
311 |
311 |
}
|
312 |
312 |
public void addToSaveNewConcept(Taxon toSaveNew) {
|
313 |
|
this.toSaveNewConcept.add(toSaveNew);
|
|
313 |
if (!toSaveNew.isPersited()){
|
|
314 |
this.toSaveNewConcepts.add(toSaveNew);
|
|
315 |
}
|
314 |
316 |
}
|
315 |
317 |
|
316 |
318 |
@Override
|
... | ... | |
323 |
325 |
if (!this.getCdmEntitySession().isActive()){
|
324 |
326 |
this.getCdmEntitySession().bind();
|
325 |
327 |
}
|
326 |
|
for(Entry<TaxonBase, TaxonBaseDeletionConfigurator> entry:toDelete.entrySet()){
|
|
328 |
for(Entry<TaxonBase, TaxonBaseDeletionConfigurator> entry:toDeletes.entrySet()){
|
327 |
329 |
delete(entry.getKey(), entry.getValue());
|
328 |
330 |
}
|
329 |
|
toDelete.clear();
|
|
331 |
toDeletes.clear();
|
330 |
332 |
for(AbstractPostOperation entry:operations){
|
331 |
333 |
EditorUtil.executeOperation(entry,sync);
|
332 |
334 |
}
|
333 |
335 |
operations.clear();
|
334 |
336 |
|
335 |
|
for (Synonym syn: toSaveNewSynonym){
|
|
337 |
for (Synonym syn: toSaveNewSynonyms){
|
336 |
338 |
for (HybridRelationship rel : syn.getName().getHybridChildRelations()){
|
337 |
339 |
if (!rel.getParentName().isPersited()) {
|
338 |
|
toSaveNewName.add(rel.getParentName());
|
|
340 |
toSaveNewNames.add(rel.getParentName());
|
339 |
341 |
}
|
340 |
342 |
if (!rel.getHybridName().isPersited()) {
|
341 |
|
toSaveNewName.add(rel.getHybridName());
|
|
343 |
toSaveNewNames.add(rel.getHybridName());
|
342 |
344 |
}
|
343 |
345 |
|
344 |
346 |
}
|
345 |
347 |
}
|
346 |
348 |
|
347 |
|
for (TaxonBase concept: toSaveNewConcept){
|
|
349 |
for (TaxonBase concept: toSaveNewConcepts){
|
348 |
350 |
for (HybridRelationship rel : concept.getName().getHybridChildRelations()){
|
349 |
351 |
if (!rel.getParentName().isPersited()) {
|
350 |
|
toSaveNewName.add(rel.getParentName());
|
|
352 |
toSaveNewNames.add(rel.getParentName());
|
351 |
353 |
}
|
352 |
354 |
if (!rel.getHybridName().isPersited()) {
|
353 |
|
toSaveNewName.add(rel.getHybridName());
|
|
355 |
toSaveNewNames.add(rel.getHybridName());
|
354 |
356 |
}
|
355 |
357 |
|
356 |
358 |
}
|
357 |
359 |
}
|
358 |
|
CdmStore.getService(INameService.class).saveOrUpdate(toSaveNewName);
|
359 |
|
CdmStore.getService(ITaxonService.class).saveOrUpdate(toSaveNewConcept);
|
|
360 |
CdmStore.getService(INameService.class).save(toSaveNewNames);
|
|
361 |
CdmStore.getService(ITaxonService.class).save(toSaveNewConcepts);
|
360 |
362 |
|
361 |
|
toSaveNewName.clear();
|
362 |
|
toSaveNewConcept.clear();
|
|
363 |
toSaveNewNames.clear();
|
|
364 |
toSaveNewConcepts.clear();
|
363 |
365 |
|
364 |
366 |
CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
|
365 |
367 |
|
... | ... | |
404 |
406 |
"sources", //$NON-NLS-1$
|
405 |
407 |
"identifiers",
|
406 |
408 |
"descriptions", //$NON-NLS-1$
|
407 |
|
// "relationsToThisTaxon.relatedFrom.name.taxonBases.taxonNodes", //$NON-NLS-1$
|
408 |
|
// "relationsToThisTaxon.relatedFrom.name.taxonBases.relationsFromThisTaxon", //$NON-NLS-1$
|
409 |
|
// "relationsToThisTaxon.relatedFrom.name.taxonBases.relationsToThisTaxon", //$NON-NLS-1$
|
410 |
|
"relationsToThisTaxon.relatedFrom.name.typeDesignations.typeSpecimen.derivedFrom.originals",//$NON-NLS-1$
|
411 |
|
"relationsToThisTaxon.relatedFrom.name.typeDesignations.typeName",//$NON-NLS-1$
|
412 |
|
// "relationsFromThisTaxon.relatedTo.name.taxonBases.taxonNodes", //$NON-NLS-1$
|
413 |
|
// "relationsFromThisTaxon.relatedTo.name.taxonBases.relationsFromThisTaxon", //$NON-NLS-1$
|
414 |
|
// "relationsFromThisTaxon.relatedTo.name.taxonBases.relationsToThisTaxon",
|
415 |
|
"relationsFromThisTaxon.relatedTo.name.typeDesignations.typeSpecimen.derivedFrom.originals",//$NON-NLS-1$
|
416 |
|
"relationsFromThisTaxon.relatedTo.name.typeDesignations.typeName",//$NON-NLS-1$
|
417 |
409 |
"taxonNodes", //$NON-NLS-1$
|
418 |
410 |
"descriptions.descriptionElements.feature", //$NON-NLS-1$
|
419 |
411 |
"descriptions.descriptionElements.area", //$NON-NLS-1$
|
... | ... | |
432 |
424 |
"synonyms.name.relationsToThisName.fromName", //$NON-NLS-1$
|
433 |
425 |
"synonyms.name.nomenclaturalReference.inReference.authorship", //$NON-NLS-1$
|
434 |
426 |
"synonyms.name.nomenclaturalReference.authorship", //$NON-NLS-1$
|
435 |
|
// "synonyms.name.homotypicalGroup", //$NON-NLS-1$
|
436 |
|
// "synonyms.synonym.name.homotypicalGroup.typifiedNames", //$NON-NLS-1$
|
437 |
427 |
"synonyms.name.homotypicalGroup.typifiedNames.taxonBases.synonyms" //$NON-NLS-1$
|
438 |
428 |
});
|
439 |
429 |
|
... | ... | |
445 |
435 |
* @param deleteConfig
|
446 |
436 |
*/
|
447 |
437 |
public void addTaxonBaseToDelete(TaxonBase selectedElement, TaxonBaseDeletionConfigurator deleteConfig) {
|
448 |
|
this.toDelete.put(selectedElement, deleteConfig);
|
|
438 |
this.toDeletes.put(selectedElement, deleteConfig);
|
449 |
439 |
|
450 |
440 |
}
|
451 |
441 |
|
... | ... | |
453 |
443 |
* @param newName
|
454 |
444 |
*/
|
455 |
445 |
public void addToSaveNewName(TaxonName newName) {
|
456 |
|
this.toSaveNewName.add(newName);
|
|
446 |
this.toSaveNewNames.add(newName);
|
457 |
447 |
}
|
458 |
448 |
|
459 |
449 |
}
|
fix #7472: fix lazy loading exceptions for MAN with type specimen