Project

General

Profile

« Previous | Next » 

Revision 0844524a

Added by Andreas Kohlbecker about 6 years ago

switching vom id based to uuid based ui navigation and entity references

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java
13 13
import java.util.Collection;
14 14
import java.util.EnumSet;
15 15
import java.util.Set;
16
import java.util.UUID;
16 17

  
17 18
import org.joda.time.DateTime;
18 19
import org.joda.time.format.ISODateTimeFormat;
......
191 192
        this.regDto = regDto;
192 193

  
193 194
        NavigationEvent navigationEvent = null;
194
        if(regDto.getCitationID() != null) {
195
        if(regDto.getCitationUuid() != null) {
195 196
            navigationEvent = new NavigationEvent(
196 197
                    RegistrationWorksetViewBean.NAME,
197
                    Integer.toString(regDto.getCitationID())
198
                    regDto.getCitationUuid().toString()
198 199
                    );
199 200
        } else {
200 201
            setComponentError(new UserError("Citation is missing"));
......
208 209
        this.parentView = parentView;
209 210

  
210 211
        ReferenceEditorAction referenceEditorAction = null;
211
        if(workingSet.getCitationId() != null){
212
            if(UserHelper.fromSession().userHasPermission(Reference.class, workingSet.getCitationId(), CRUD.UPDATE)){
213
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationId(), null, parentView);
212
        if(workingSet.getCitationUuid() != null){
213
            if(UserHelper.fromSession().userHasPermission(Reference.class, workingSet.getCitationUuid(), CRUD.UPDATE)){
214
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.EDIT, workingSet.getCitationUuid(), null, parentView);
214 215
            }
215
            PermissionDebugUtils.addGainPerEntityPermissionButton(this, Reference.class, workingSet.getCitationId(), EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null);
216
            PermissionDebugUtils.addGainPerEntityPermissionButton(this, Reference.class, workingSet.getCitationUuid(), EnumSet.of(CRUD.UPDATE, CRUD.DELETE), null);
216 217
        } else {
217 218
            if(UserHelper.fromSession().userHasPermission(Reference.class, CRUD.CREATE, null, null, parentView)){
218 219
                referenceEditorAction = new ReferenceEditorAction(EditorActionType.ADD);
......
245 246
            getMessageButton().addClickListener(e -> {
246 247
                ShowDetailsEvent detailsEvent;
247 248
                if(regDto != null){
248
                    detailsEvent = new ShowDetailsEvent<RegistrationDTO, Integer>(
249
                    detailsEvent = new ShowDetailsEvent<RegistrationDTO, UUID>(
249 250
                            e,
250 251
                            RegistrationDTO.class,
251
                            regDto.getId(),
252
                            regDto.getUuid(),
252 253
                            VALIDATION_PROBLEMS);
253 254
                } else {
254
                    detailsEvent = new ShowDetailsEvent<RegistrationWorkingSet, Integer>(
255
                    detailsEvent = new ShowDetailsEvent<RegistrationWorkingSet, UUID>(
255 256
                            e,
256 257
                            RegistrationWorkingSet.class,
257 258
                            null,
......
329 330
        }
330 331
    }
331 332

  
332
    public int getRegistrationId(){
333
        return regDto.getId();
333
    public UUID getRegistrationUuid(){
334
        return regDto.getUuid();
334 335
    }
335 336

  
336 337
    /**

Also available in: Unified diff