Project

General

Profile

Actions

feature request #7680

closed

Refactor TaxonNodeDetailElement

Added by Patrick Plitzner over 4 years ago. Updated about 4 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 #1

Updated by Patrick Plitzner over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Patrick Plitzner over 4 years ago

  • Copied from bug #7679: NPE when creating root child in classification added
Actions #3

Updated by Katja Luther over 4 years ago

  • Priority changed from New to Highest
  • Target version changed from Unassigned CDM tickets to Release 5.3
Actions #4

Updated by Katja Luther over 4 years ago

  • Status changed from New to In Progress

the problems of not visible unplaced, excluded and publish checkboxes are fixed now. But to implement the NewTaxonNodeWizard the same way as the other NewWizards we need to add the possibility to create a taxonNode or to change the taxon of a taxonNode. Maybe we should discuss this before we implement these options.

Actions #5

Updated by Katja Luther over 4 years ago

  • Target version changed from Release 5.3 to Release 5.4

the functionality is available now, but as described in the comment above we would need the functionality to create a TaxonNode without a taxon to use the newWizard the same as the other newWizards. Therefore I move this ticket to next release.

Actions #6

Updated by Andreas Müller over 4 years ago

  • Target version changed from Release 5.4 to Release 5.5
  • % Done changed from 0 to 20

some work has been done within #7793, I added the commits to this ticket.

However, due to the described problem a complete refactoring of the taxon node wizard is not yet done so I move ticket to next milestone

Actions #7

Updated by Katja Luther about 4 years ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

now the newTaxonNodeWizard works like the other newEntityWizards and the taxonnode is created when the wizard opens and the changes are made directly in this new entity.

Actions #8

Updated by Andreas Müller about 4 years ago

  • Assignee changed from Andreas Müller to Patrick Plitzner
  • % Done changed from 20 to 50

As PP opened this ticket and as it is mostly about code design I think it is better if he reviews this ticket.

How did you solve the problem that TaxonNodes can not be instantiate (yet)?

Actions #9

Updated by Patrick Plitzner about 4 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Patrick Plitzner to Katja Luther

I have not stepped through all lines of code but still the saveEntity() method seems to do too much. A new taxon is created and UI properties are assigned to CDM entities. In almost all other wizards the method is a one-liner like in the example in the ticket description.

The wizard itself works nonetheless except for some smalles issues -> #8036, #8037

Actions #10

Updated by Katja Luther about 4 years ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Katja Luther to Patrick Plitzner

Patrick Plitzner wrote:

I have not stepped through all lines of code but still the saveEntity() method seems to do too much. A new taxon is created and UI properties are assigned to CDM entities. In almost all other wizards the method is a one-liner like in the example in the ticket description.

The wizard itself works nonetheless except for some smalles issues -> #8036, #8037

code is cleaned and unnecessary code removed

Actions #11

Updated by Patrick Plitzner about 4 years ago

  • Status changed from Resolved to Closed
  • Assignee changed from Patrick Plitzner to Katja Luther
  • % Done changed from 50 to 100

Looks much better now. There is still happening a lot compared to the other "New-"wizards but a taxon node is a highly linked structure.

Actions #12

Updated by Katja Luther almost 4 years ago

  • Related to bug #7689: Mutliple representation exception when creating taxon nodes added
Actions

Also available in: Atom PDF