Project

General

Profile

« Previous | Next » 

Revision 8662bcde

Added by Andreas Kohlbecker over 3 years ago

ref #9105 extending init strategy for checkEmpty() in model classes - restoring lost chnaged from earlier

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
329 329
    @Override
330 330
    protected TaxonName loadCdmEntity(UUID identifier) {
331 331

  
332
        EntityInitStrategy initStrategy = new EntityInitStrategy(Arrays.asList("$", "annotations.type", "annotations.*", // needed
333
                                                                                                                         // as
334
                                                                                                                         // log
335
                                                                                                                         // as
336
                                                                                                                         // we
337
                                                                                                                         // are
338
                                                                                                                         // using
339
                                                                                                                         // a
340
                                                                                                                         // table
341
                                                                                                                         // in
342
                                                                                                                         // FilterableAnnotationsField
332
        EntityInitStrategy initStrategy = new EntityInitStrategy(
333
                Arrays.asList(
334
                "$",
335
                "annotations.type",
336
                "annotations.*", // needed as log as we are using a table in FilterableAnnotationsField
343 337
                "rank.vocabulary", // needed for comparing ranks
344 338

  
345 339
                "nomenclaturalSource.citation",
340
                "nomenclaturalSource.annotations", // needed to allow access in AnnotatableEntity.checkEmpty()
341
                "nomenclaturalSource.markers",  // needed to allow access in AnnotatableEntity.checkEmpty()
342
                "nomenclaturalSource.links",  // needed to allow access in OriginalSourceBase.checkEmpty()
346 343

  
347
                "status.type", "status.citation",
344
                "status.type",
345
                "status.citation",
348 346

  
349
                "combinationAuthorship", "exCombinationAuthorship", "basionymAuthorship", "exBasionymAuthorship",
347
                "combinationAuthorship",
348
                "exCombinationAuthorship",
349
                "basionymAuthorship",
350
                "exBasionymAuthorship",
350 351

  
351 352
                // basionyms: relationsToThisName.fromName
352
                "relationsToThisName.type", "relationsToThisName.fromName.rank",
353
                "relationsToThisName.type",
354
                "relationsToThisName.fromName.rank",
353 355
                "relationsToThisName.fromName.combinationAuthorship",
354 356
                "relationsToThisName.fromName.exCombinationAuthorship",
355 357
                "relationsToThisName.fromName.nomenclaturalSource.citation.authorship",
356 358
                "relationsToThisName.fromName.nomenclaturalSource.citation.inReference.authorship",
357 359
                "relationsToThisName.fromName.nomenclaturalSource.citation.inReference.inReference.inReference.authorship",
358 360
                "relationsToThisName.fromName.relationsToThisName",
359
                "relationsToThisName.fromName.relationsFromThisName", "relationsToThisName.citation",
360
                "relationsFromThisName", "homotypicalGroup.typifiedNames"));
361
                "relationsToThisName.fromName.relationsFromThisName",
362
                "relationsToThisName.citation",
363
                "relationsFromThisName",
364
                "homotypicalGroup.typifiedNames"
365
                )
366
              );
361 367
        initStrategy.extend("nomenclaturalSource.citation", ReferenceEllypsisFormatter.INIT_STRATEGY, false);
362 368
        initStrategy.extend("status.citation", ReferenceEllypsisFormatter.INIT_STRATEGY, false);
363 369
        initStrategy.extend("relationsToThisName.citation", ReferenceEllypsisFormatter.INIT_STRATEGY, false);
......
613 619
                            WeaklyRelatedEntityCombobox<TaxonName> weaklyRelatedEntityCombobox = (WeaklyRelatedEntityCombobox<TaxonName>) getView()
614 620
                                    .getGenusOrUninomialField();
615 621
                            weaklyRelatedEntityCombobox.setValue(((TaxonName) event.getEntity()).getGenusOrUninomial());
616
                            // NOTE: in contrast to the
617
                            // ToOneRelatedEntityCombobox the .discard() does
618
                            // not
619
                            // work here since no datasource is bound to the
620
                            // field, see weaklyRelatedEntityCombobox.reload()
622
                            // NOTE: in contrast to the ToOneRelatedEntityCombobox the .discard() does not
623
                            // work here since no datasource is bound to the field, see weaklyRelatedEntityCombobox.reload()
621 624
                            weaklyRelatedEntityCombobox.updateButtons();
622 625
                        }
623 626
                    }
......
630 633
                            getView().getSpecificEpithetField()
631 634
                                    .setValue(((TaxonName) event.getEntity()).getSpecificEpithet());
632 635
                            weaklyRelatedEntityCombobox.reload();
633
                            // NOTE: in contrast to the
634
                            // ToOneRelatedEntityCombobox the .discard() does
635
                            // not
636
                            // work here since no datasource is bound to the
637
                            // field, see weaklyRelatedEntityCombobox.reload()
636
                            // NOTE: in contrast to the ToOneRelatedEntityCombobox the .discard() does not
637
                            // work here since no datasource is bound to the field, see weaklyRelatedEntityCombobox.reload()
638 638
                            weaklyRelatedEntityCombobox.updateButtons();
639 639
                        }
640 640
                    }
......
646 646
                        } else {
647 647
                            getView().getNomReferenceCombobox().reload(); // refreshSelectedValue(modifiedReference);
648 648
                        }
649
                        getView().getCombinationAuthorshipField().discard(); // refresh
650
                                                                             // from
651
                                                                             // the
652
                                                                             // datasource
649
                        getView().getCombinationAuthorshipField().discard(); //refresh from the datasource
653 650
                        getView().updateAuthorshipFields();
654 651
                    }
655 652
                } else if (boundTargetField.matchesPropertyIdPath("validationFor.otherName")
......
682 679
                        } else {
683 680
                            basionymSourceField.reloadWith((TaxonName) event.getEntity());
684 681
                        }
685
                        getView().getBasionymAuthorshipField().discard(); // refresh
686
                                                                          // from
687
                                                                          // the
688
                                                                          // datasource
689
                        getView().getExBasionymAuthorshipField().discard(); // refresh
690
                                                                            // from
691
                                                                            // the
692
                                                                            // datasource
682
                        getView().getBasionymAuthorshipField().discard(); //refresh from the datasource
683
                        getView().getExBasionymAuthorshipField().discard(); //refresh from the datasource
693 684
                        getView().updateAuthorshipFields();
694 685
                    } else if (event.isRemovedType()) {
695 686
                        basionymSourceField.setValue(null);
......
707 698
                        } else {
708 699
                            replacedSynonyms.reloadWith((TaxonName) event.getEntity());
709 700
                        }
710
                        getView().getExCombinationAuthorshipField().discard(); // refresh
711
                                                                               // from
712
                                                                               // the
713
                                                                               // datasource
701
                        getView().getExCombinationAuthorshipField().discard(); //refresh from the datasource
714 702
                        getView().updateAuthorshipFields();
715 703
                    } else if (event.isRemovedType()) {
716 704
                        replacedSynonyms.setValue(null);

Also available in: Unified diff