Project

General

Profile

Revision ee57c0d9

IDee57c0d99c221528fa090a91b38bf0e89e5e62a3
Parent 7ebcfd4b
Child 10d072e7

Added by Andreas Kohlbecker 8 months ago

ref #8050 fixing bug in reloadRegistrtions() and removing remain from previous conflict

View differences:

src/main/java/eu/etaxonomy/cdm/service/IRegistrationWorkflowService.java
37 37
    boolean createRegistrationforExistingName(RegistrationWorkingSet workingset, TaxonName typifiedName) throws RegistrationValidationException;
38 38

  
39 39
    @Transactional(readOnly=true)
40
    void reloadRegistration(Registration registration);
40
    Registration reloadRegistration(Registration registration);
41 41

  
42 42
    /**
43 43
     * Creates a new registration for the name referenced by the {@code taxonNameUUID} parameter
src/main/java/eu/etaxonomy/cdm/service/RegistrationWorkflowService.java
103 103

  
104 104
    @Override
105 105
    public void addTypeDesignation(UUID typeDesignationUuid, Registration registration) {
106
        reloadRegistration(registration);
106
        registration = reloadRegistration(registration);
107 107
        getRepo().getRegistrationService().addTypeDesignation(registration, typeDesignationUuid);
108 108
        getRepo().getRegistrationService().saveOrUpdate(registration);
109 109
    }
......
127 127

  
128 128
        if(!registrationExists){
129 129
            Registration blockingRegistration = getRepo().getRegistrationService().createRegistrationForName(nameUUID);
130
            reloadRegistration(registration);
130
            registration = reloadRegistration(registration);
131 131
            registration.getBlockedBy().add(blockingRegistration);
132 132
            if(registration.isPersited()){
133 133
                getRepo().getRegistrationService().saveOrUpdate(registration);
......
143 143
     * @return
144 144
     */
145 145
    @Override
146
    public void reloadRegistration(Registration registration) {
146
    public Registration reloadRegistration(Registration registration) {
147 147
        if(registration.isPersited()){
148 148
             Registration registrationReloaded = getRepo().getRegistrationService().load(registration.getUuid());
149 149
             if(registrationReloaded == null){
......
153 153
         } else {
154 154
             logger.trace("Registration is not yet persisted.");
155 155
         }
156

  
157
        return registration;
156 158
    }
157 159

  
158 160
    /**
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java
453 453

  
454 454
            for(TaxonName name : namesToCheck){
455 455
                if(name != null){
456
                    clearSession();
456 457
                    doRefreshView |= registrationWorkflowService.addBlockingRegistration(name.getUuid(), registration) != null;
457 458
                }
458 459
            }
......
625 626

  
626 627
                try {
627 628
                    clearSession();
628
                    getRepo().getSession().clear();
629
                    Stack<EditorActionContext>context = ((AbstractPopupEditor)event.getPopup()).getEditorActionContext();
630
                    registration = findRegistrationInContext(context);
629 631
                    registrationWorkflowService.addTypeDesignation(typeDesignationUuid, registration);
630 632
                    nameTypeDesignationPopupEditorRegistrationUUIDMap.remove(event.getPopup());
631 633
                } finally {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)