feature request #7680
closed
Refactor TaxonNodeDetailElement
Added by Patrick Plitzner over 5 years ago.
Updated about 5 years ago.
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())
- Description updated (diff)
- Copied from bug #7679: NPE when creating root child in classification added
- Priority changed from New to Highest
- Target version changed from Unassigned CDM tickets to Release 5.3
- 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.
- 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.
- 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
- 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.
- 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)?
- 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
- 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
- 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.
- Related to bug #7689: Mutliple representation exception when creating taxon nodes added
Also available in: Atom
PDF