Project

General

Profile

Actions

feature request #7680

closed

Refactor TaxonNodeDetailElement

Added by Patrick Plitzner over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal

Description

Copied from #7679:

While investigating this issue I realized that the NewTaxonNodeWizard does not work like all the other "new" wizards.

Usually the sequence is as follows:

1.In AbstractNewEntityWizard.createNewEntity() a new instance of the class is created.

    protected Reference createNewEntity() {
        return ReferenceFactory.newGeneric();
    }

2.The wizard page returns a detail element for the newly created entity via AbstractCdmEntityWizardPage.getDetailElement() This is the same element as used in the DetailsView.
3.The handleEvent() method listens to editing changes in the detail element and stores the parameters to the newly created entity

public void handleEvent(Object eventSource) {
        if (eventSource == combo_referenceType) {
            getEntity().setType(combo_referenceType.getSelection());

4.When closing the wizard AbstractNewEntityWizard.saveEntity() is invoked

    protected void saveEntity() {
        CdmStore.getService(IReferenceService.class).save(getEntity());
    }
  • The new taxon node wizard does not create a new entity but uses the current selection.
  • This is why all these exception are thrown when creating a root child because the entity used in the wizard is the classification and not the new taxon node as it should be.
  • Only during saveEntity() a new taxon instance is created (should be done createNewEntity()) and all the UI parameter fields are stored to the taxon (should be done in handleEvent())

Related issues

Related to EDIT - bug #7689: Mutliple representation exception when creating taxon nodesWorksformeKatja Luther

Actions
Copied from EDIT - bug #7679: NPE when creating root child in classificationClosedPatrick Plitzner

Actions
Actions

Also available in: Atom PDF