Project

General

Profile

« Previous | Next » 

Revision a4ef0a5a

Added by Andreas Kohlbecker over 6 years ago

SpecimenTypeDesignationWorkingSetDTO with nore knowledge on typifiedName and citation simplifies presenters

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationSetManager.java
77 77
     */
78 78
    private LinkedHashMap<TypedEntityReference, TypeDesignationWorkingSet> orderedByTypesByBaseEntity;
79 79

  
80
    private EntityReference typifiedName;
80
    private EntityReference typifiedNameRef;
81

  
82
    private TaxonName typifiedName;
81 83

  
82 84
    private String finalString = null;
83 85

  
......
95 97
     */
96 98
    public TypeDesignationSetManager(Collection<TypeDesignationBase> typeDesignations) throws RegistrationValidationException {
97 99
        this.typeDesignations = typeDesignations;
98
        this.typifiedName = findTypifiedName();
100
        findTypifiedName();
99 101
        mapAndSort();
100 102
    }
101 103

  
......
104 106
     */
105 107
    public TypeDesignationSetManager(TaxonName typifiedName) {
106 108
        this.typeDesignations = new ArrayList<>();
107
        this.typifiedName = new EntityReference(typifiedName.getId(), typifiedName.getTitleCache());
109
        this.typifiedNameRef = new EntityReference(typifiedName.getId(), typifiedName.getTitleCache());
108 110
    }
109 111

  
110 112
    /**
......
347 349
     * @return
348 350
     * @throws RegistrationValidationException
349 351
     */
350
    private EntityReference findTypifiedName() throws RegistrationValidationException {
352
    private void findTypifiedName() throws RegistrationValidationException {
351 353

  
352 354
        List<String> problems = new ArrayList<>();
353 355

  
......
385 387
        }
386 388

  
387 389
        if(typifiedName != null){
388
            return new EntityReference(typifiedName.getId(), typifiedName.getTitleCache());
390
            // ON SUCCESS -------------------
391
            this.typifiedName = typifiedName;
392
            this.typifiedNameRef = new EntityReference(typifiedName.getId(), typifiedName.getTitleCache());
393

  
389 394
        }
390
        return null;
391 395
    }
392 396

  
393 397

  
......
395 399
     * @return the title cache of the typifying name or <code>null</code>
396 400
     */
397 401
    public String getTypifiedNameCache() {
398
        if(typifiedName != null){
399
            return typifiedName.getLabel();
402
        if(typifiedNameRef != null){
403
            return typifiedNameRef.getLabel();
400 404
        }
401 405
        return null;
402 406
    }
......
404 408
    /**
405 409
     * @return the title cache of the typifying name or <code>null</code>
406 410
     */
407
    public EntityReference getTypifiedName() {
411
    public EntityReference getTypifiedNameRef() {
408 412

  
409
       return typifiedName;
413
       return typifiedNameRef;
410 414
    }
411 415

  
412 416
    /**
......
579 583
        this.printCitation = printCitation;
580 584
    }
581 585

  
586
    /**
587
     * @return the typifiedName
588
     */
589
    public TaxonName getTypifiedName() {
590
        return typifiedName;
591
    }
592

  
582 593
    /**
583 594
     * TypeDesignations which refer to the same FieldUnit (SpecimenTypeDesignation) or TaxonName
584 595
     * (NameTypeDesignation) form a working set. The <code>TypeDesignationWorkingSet</code> internally

Also available in: Unified diff