Project

General

Profile

Revision 2a2845ce

ID2a2845cefcb5dd887ba96665180c97b5d63ff11c
Parent d46672d0
Child 11247507

Added by Andreas Kohlbecker over 2 years ago

fix #7628 removing misconception in workflow code

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
171 171
        return new  CdmStore<TaxonName, INameService>(getRepo(), getRepo().getNameService());
172 172
    }
173 173

  
174

  
174
    /**
175
     * Checks
176
     * <ol>
177
     * <li>if there is any registration for this name created in the current registration system</li>
178
     * <li>Checks if the name belongs to the current workingset</li>
179
     * </ol>
180
     * If both checks are successful the method returns <code>true</code>.
181
     */
175 182
    public boolean canCreateRegistrationForName(TaxonName name) {
176 183
        for(Registration reg : name.getRegistrations()){
177 184
            if(minter.isFromOwnRegistration(reg.getIdentifier())){
......
532 539
            return;
533 540
        }
534 541

  
535
        getView().getAddExistingNameCombobox().commit();
542
        getView().getAddExistingNameCombobox().commit(); // update the chosen value in the datasource
536 543
        TaxonName typifiedName = getView().getAddExistingNameCombobox().getValue();
537 544
        if(typifiedName != null){
538 545
            boolean reloadWorkingSet = false;
539 546
            Reference citation = getRepo().getReferenceService().find(workingset.getCitationUuid());
540
            if(event.getType() == ExistingNameRegistrationType.NAME_TYPIFICATION && canCreateRegistrationForName(typifiedName)){
547
            // here we completely ignore the ExistingNameRegistrationType since the user should not have the choice
548
            // to create a typification only registration in the working (publication) set which contains
549
            // the protologe. This is known from the nomenclatural reference.
550
            if(canCreateRegistrationForName(typifiedName)){
551
                // the citation which is the base for workingset contains the protologe of the name and the name hast not
552
                // been registered before:
553
                // create a registration for the name and the first typifications
541 554
                Registration newRegistrationWithExistingName = createNewRegistrationForName(typifiedName.getUuid());
542 555
                newRegistrationDTOWithExistingName = new RegistrationDTO(newRegistrationWithExistingName, typifiedName, citation);
543 556
                reloadWorkingSet = true;
544 557
            } else {
545
                // case: ExistingNameRegistrationType.TYPIFICATION_ONLY
558
                // create a typification only registration
559
                // FIXME: this should not be possible if the names protologue is in the workingset --> #
546 560
                Registration newRegistrationWithExistingName = createNewRegistrationForName(null);
547 561
                newRegistrationDTOWithExistingName = new RegistrationDTO(newRegistrationWithExistingName, typifiedName, citation);
548
                Registration blockingRegistration = createNewRegistrationForName(typifiedName.getUuid());
549
                newRegistrationWithExistingName.getBlockedBy().add(blockingRegistration);
550 562
            }
551 563
            workingset.add(newRegistrationDTOWithExistingName);
552 564
            // tell the view to update the workingset

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)