Revision d9a042e5
Added by Andreas Müller almost 2 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java | ||
---|---|---|
41 | 41 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO; |
42 | 42 |
import eu.etaxonomy.cdm.api.service.dto.RegistrationWorkingSet; |
43 | 43 |
import eu.etaxonomy.cdm.api.service.exception.RegistrationValidationException; |
44 |
import eu.etaxonomy.cdm.api.service.name.TypeDesignationWorkingSet.TypeDesignationWorkingSetType;
|
|
44 |
import eu.etaxonomy.cdm.api.service.name.TypeDesignationSet.TypeDesignationSetType;
|
|
45 | 45 |
import eu.etaxonomy.cdm.api.service.registration.IRegistrationWorkingSetService; |
46 | 46 |
import eu.etaxonomy.cdm.api.util.UserHelper; |
47 | 47 |
import eu.etaxonomy.cdm.cache.CdmTransientEntityAndUuidCacher; |
... | ... | |
75 | 75 |
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent; |
76 | 76 |
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEventEntityTypeFilter; |
77 | 77 |
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction; |
78 |
import eu.etaxonomy.cdm.vaadin.event.TypeDesignationWorkingsetEditorAction;
|
|
78 |
import eu.etaxonomy.cdm.vaadin.event.TypeDesignationSetEditorAction;
|
|
79 | 79 |
import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkingsetAction; |
80 | 80 |
import eu.etaxonomy.cdm.vaadin.ui.RegistrationUIDefaults; |
81 | 81 |
import eu.etaxonomy.cdm.vaadin.ui.config.TaxonNamePopupEditorConfig; |
82 | 82 |
import eu.etaxonomy.cdm.vaadin.util.CdmTitleCacheCaptionGenerator; |
83 | 83 |
import eu.etaxonomy.cdm.vaadin.view.name.CachingPresenter; |
84 | 84 |
import eu.etaxonomy.cdm.vaadin.view.name.NameTypeDesignationPopupEditor; |
85 |
import eu.etaxonomy.cdm.vaadin.view.name.NameTypeDesignationWorkingsetIds;
|
|
86 |
import eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationWorkingsetIds;
|
|
87 |
import eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationWorkingsetPopupEditor;
|
|
85 |
import eu.etaxonomy.cdm.vaadin.view.name.NameTypeDesignationSetIds;
|
|
86 |
import eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationSetIds;
|
|
87 |
import eu.etaxonomy.cdm.vaadin.view.name.SpecimenTypeDesignationSetPopupEditor;
|
|
88 | 88 |
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter; |
89 | 89 |
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor; |
90 | 90 |
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditorMode; |
... | ... | |
541 | 541 |
} |
542 | 542 |
|
543 | 543 |
@EventBusListenerMethod(filter = EditorActionTypeFilter.Edit.class) |
544 |
public void onTypeDesignationsEditorActionEdit(TypeDesignationWorkingsetEditorAction event) {
|
|
544 |
public void onTypeDesignationsEditorActionEdit(TypeDesignationSetEditorAction event) {
|
|
545 | 545 |
|
546 | 546 |
if(!checkFromOwnView(event)){ |
547 | 547 |
return; |
... | ... | |
549 | 549 |
|
550 | 550 |
RegistrationDTO registrationDTO = workingset.getRegistrationDTO(event.getRegistrationUuid()).get(); |
551 | 551 |
|
552 |
if(event.getWorkingSetType() == TypeDesignationWorkingSetType.SPECIMEN_TYPE_DESIGNATION_WORKINGSET ){
|
|
553 |
SpecimenTypeDesignationWorkingsetPopupEditor popup = openPopupEditor(SpecimenTypeDesignationWorkingsetPopupEditor.class, event);
|
|
552 |
if(event.getWorkingSetType() == TypeDesignationSetType.SPECIMEN_TYPE_DESIGNATION_SET ){
|
|
553 |
SpecimenTypeDesignationSetPopupEditor popup = openPopupEditor(SpecimenTypeDesignationSetPopupEditor.class, event);
|
|
554 | 554 |
popup.setParentEditorActionContext(event.getContext(), event.getTarget()); |
555 | 555 |
popup.withDeleteButton(true); |
556 |
popup.loadInEditor(new SpecimenTypeDesignationWorkingsetIds(
|
|
556 |
popup.loadInEditor(new SpecimenTypeDesignationSetIds(
|
|
557 | 557 |
workingset.getCitationUuid(), |
558 | 558 |
event.getRegistrationUuid(), |
559 | 559 |
CdmBase.deproxy(event.getBaseEntity(), FieldUnit.class), null)); |
... | ... | |
565 | 565 |
NameTypeDesignationPopupEditor popup = openPopupEditor(NameTypeDesignationPopupEditor.class, event); |
566 | 566 |
popup.setParentEditorActionContext(event.getContext(), event.getTarget()); |
567 | 567 |
popup.withDeleteButton(true); |
568 |
popup.loadInEditor(NameTypeDesignationWorkingsetIds.forExistingTypeDesignation(
|
|
568 |
popup.loadInEditor(NameTypeDesignationSetIds.forExistingTypeDesignation(
|
|
569 | 569 |
registrationDTO.getCitationUuid(), |
570 | 570 |
CdmBase.deproxy(event.getBaseEntity(), NameTypeDesignation.class)) |
571 | 571 |
); |
... | ... | |
579 | 579 |
} |
580 | 580 |
|
581 | 581 |
@EventBusListenerMethod(filter = EditorActionTypeFilter.Add.class) |
582 |
public void onTypeDesignationWorkingsetAdd(TypeDesignationWorkingsetEditorAction event) {
|
|
582 |
public void onTypeDesignationSetAdd(TypeDesignationSetEditorAction event) {
|
|
583 | 583 |
|
584 | 584 |
if(!event.hasSource()){ |
585 | 585 |
return; |
... | ... | |
587 | 587 |
|
588 | 588 |
RegistrationDTO registrationDTO = workingset.getRegistrationDTO(event.getRegistrationUuid()).get(); |
589 | 589 |
|
590 |
if(event.getWorkingSetType() == TypeDesignationWorkingSetType.SPECIMEN_TYPE_DESIGNATION_WORKINGSET){
|
|
591 |
SpecimenTypeDesignationWorkingsetPopupEditor popup = openPopupEditor(SpecimenTypeDesignationWorkingsetPopupEditor.class, event);
|
|
590 |
if(event.getWorkingSetType() == TypeDesignationSetType.SPECIMEN_TYPE_DESIGNATION_SET){
|
|
591 |
SpecimenTypeDesignationSetPopupEditor popup = openPopupEditor(SpecimenTypeDesignationSetPopupEditor.class, event);
|
|
592 | 592 |
popup.setParentEditorActionContext(event.getContext(), event.getTarget()); |
593 | 593 |
TypedEntityReference<TaxonName> typifiedNameRef; |
594 | 594 |
if(registrationDTO.getTypifiedNameRef() != null){ |
... | ... | |
601 | 601 |
|
602 | 602 |
popup.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE)); |
603 | 603 |
popup.withDeleteButton(false); |
604 |
popup.loadInEditor(new SpecimenTypeDesignationWorkingsetIds(
|
|
604 |
popup.loadInEditor(new SpecimenTypeDesignationSetIds(
|
|
605 | 605 |
workingset.getCitationUuid(), |
606 | 606 |
event.getRegistrationUuid(), |
607 | 607 |
null, |
... | ... | |
633 | 633 |
} |
634 | 634 |
}); |
635 | 635 |
popup.withDeleteButton(false); |
636 |
popup.loadInEditor(NameTypeDesignationWorkingsetIds.forNewTypeDesignation(
|
|
636 |
popup.loadInEditor(NameTypeDesignationSetIds.forNewTypeDesignation(
|
|
637 | 637 |
registrationDTO.getCitationUuid(), |
638 | 638 |
event.getTypifiedNameUuid() |
639 | 639 |
) |
... | ... | |
666 | 666 |
return; |
667 | 667 |
} |
668 | 668 |
|
669 |
if(event.getPopup() instanceof SpecimenTypeDesignationWorkingsetPopupEditor){
|
|
669 |
if(event.getPopup() instanceof SpecimenTypeDesignationSetPopupEditor){
|
|
670 | 670 |
if(event.getReason().equals(Reason.SAVE)){ |
671 | 671 |
// NOTE: adding the SpecimenTypeDesignations to the registration is done in the |
672 |
// SpecimenTypeDesignationWorkingSetServiceImpl.save(SpecimenTypeDesignationWorkingSetDTO dto) method
|
|
672 |
// SpecimenTypeDesignationSetServiceImpl.save(SpecimenTypeDesignationSetDTO dto) method
|
|
673 | 673 |
} |
674 | 674 |
// always reload if the first editor is closed as the data might have been changed through any other sub-popupeditor |
675 | 675 |
refreshView(isAtContextRoot(event.getPopup())); |
Also available in: Unified diff
ref #10089 rename TypeDesignationWorkingSet to TypeDesignationSet in vaadin