Project

General

Profile

feature request #7680

Refactor TaxonNodeDetailElement

Added by Patrick Plitzner 12 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
Start date:
08/24/2018
Due date:
% Done:

100%

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 nodes Worksforme 08/27/2018
Copied from Edit - bug #7679: NPE when creating root child in classification Closed 08/23/2018

Associated revisions

Revision e04a2b79 (diff)
Added by Katja Luther 12 months ago

ref #7680: unplaced, excluded and publish checkboxes should be available in NewTaxonnodeWizard

Revision 9da648a0 (diff)
Added by Katja Luther 12 months ago

ref #7680: fix NPE for excluded notes

Revision 4443b90a (diff)
Added by Katja Luther 10 months ago

ref #7793: adapt taxonnode wizard and add menu item to set unplaced in navigator

Revision 83f2186a (diff)
Added by Katja Luther 10 months ago

ref #7793: adapt taxonnode wizard and add menu item to set excluded in navigator

Revision 05a6f11d (diff)
Added by Katja Luther 10 months ago

ref #7793: add preference for show taxonnode wizard

Revision c6aeda45 (diff)
Added by Katja Luther 7 months ago

ref #7680: set TaxonNode.setTaxon public and new saveMethod for taxonnodes

Revision e4a9f18a (diff)
Added by Katja Luther 7 months ago

ref #7680: refactor NewTaxonNodeWizard like other NewEntityWizards

Revision 326dab64 (diff)
Added by Katja Luther 7 months ago

ref #7680: code cleaning remove unnecessary code

History

#1 Updated by Patrick Plitzner 12 months ago

  • Description updated (diff)

#2 Updated by Patrick Plitzner 12 months ago

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

#3 Updated by Katja Luther 12 months ago

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

#4 Updated by Katja Luther 12 months 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.

#5 Updated by Katja Luther 12 months 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.

#6 Updated by Andreas Müller 10 months 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

#7 Updated by Katja Luther 7 months 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.

#8 Updated by Andreas Müller 7 months 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)?

#9 Updated by Patrick Plitzner 7 months 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

#10 Updated by Katja Luther 7 months 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

#11 Updated by Patrick Plitzner 7 months 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.

#12 Updated by Katja Luther 6 months ago

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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)