Project

General

Profile

« Previous | Next » 

Revision f972ab15

Added by Andreas Müller almost 3 years ago

ref #9331 adapt vaadin to NamedSource

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/model/name/NomenclaturalStatusDTO.java
10 10

  
11 11
import java.io.Serializable;
12 12

  
13
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
14 13
import eu.etaxonomy.cdm.model.name.NomenclaturalCodeEdition;
15 14
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
16 15
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
16
import eu.etaxonomy.cdm.model.reference.NamedSource;
17 17
import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
18 18
import eu.etaxonomy.cdm.model.reference.Reference;
19 19

  
......
68 68
            if (nomStatus.getSource() == null) {
69 69
                // below line as in
70 70
                // DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource)
71
                nomStatus.setSource(DescriptionElementSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource));
71
                nomStatus.setSource(NamedSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource));
72 72
            }
73 73
            nomStatus.getSource().setCitation(citation);
74 74
            nomStatus.getSource().setCitationMicroReference(citationMicroReference);
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/NameTypeDesignationPresenter.java
34 34
import eu.etaxonomy.cdm.format.reference.ReferenceEllypsisFormatter.LabelType;
35 35
import eu.etaxonomy.cdm.model.common.Annotation;
36 36
import eu.etaxonomy.cdm.model.common.AnnotationType;
37
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
38 37
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
39 38
import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
40 39
import eu.etaxonomy.cdm.model.name.TaxonName;
41 40
import eu.etaxonomy.cdm.model.permission.CRUD;
41
import eu.etaxonomy.cdm.model.reference.NamedSource;
42
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
42 43
import eu.etaxonomy.cdm.model.reference.Reference;
43 44
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
44 45
import eu.etaxonomy.cdm.model.reference.ReferenceType;
......
91 92
     * This may be any type listed in {@link RegistrationUIDefaults#NOMECLATURAL_PUBLICATION_UNIT_TYPES}
92 93
     * but never a {@link ReferenceType#Section}
93 94
     */
94
    private DescriptionElementSource publishedUnit;
95
    private NamedSourceBase publishedUnit;
95 96

  
96 97
    protected static BeanInstantiator<NameTypeDesignation> defaultBeanInstantiator = new BeanInstantiator<NameTypeDesignation>() {
97 98

  
......
119 120
        if(idset.isForNewTypeDesignation()) {
120 121
            Reference reference = getRepo().getReferenceService().load(idset.getPublishedUnitUuid());
121 122
            try {
122
                setPublishedUnit(DescriptionElementSource.NewPrimarySourceInstance(reference, null));
123
                setPublishedUnit(NamedSource.NewPrimarySourceInstance(reference, null));
123 124
            } catch(Exception e) {
124 125
                throw new RuntimeException("Refernce of invalid type passed via NameTypeDesignationWorkingsetIds as publishedUnitUuid ", e);
125 126
            }
......
420 421
     * @return
421 422
     *  the {@link #publishedUnit}
422 423
     */
423
    public DescriptionElementSource getPublishedUnit() {
424
    public NamedSourceBase getPublishedUnit() {
424 425
        return publishedUnit;
425 426
    }
426 427

  
......
429 430
     *  The unit of publication in which the type designation has been published.
430 431
     *  This may be any type listed in {@link RegistrationUIDefaults#NOMECLATURAL_PUBLICATION_UNIT_TYPES}
431 432
     */
432
    protected void setPublishedUnit(DescriptionElementSource publishedUnit) throws Exception {
433
    protected void setPublishedUnit(NamedSourceBase publishedUnit) throws Exception {
433 434
        if(publishedUnit == null) {
434 435
            throw new NullPointerException();
435 436
        }
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
40 40
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
41 41
import eu.etaxonomy.cdm.model.common.AnnotationType;
42 42
import eu.etaxonomy.cdm.model.common.CdmBase;
43
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
44 43
import eu.etaxonomy.cdm.model.location.Country;
45 44
import eu.etaxonomy.cdm.model.name.Registration;
46 45
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
......
49 48
import eu.etaxonomy.cdm.model.occurrence.Collection;
50 49
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
51 50
import eu.etaxonomy.cdm.model.permission.CRUD;
51
import eu.etaxonomy.cdm.model.reference.NamedSource;
52
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
52 53
import eu.etaxonomy.cdm.model.reference.Reference;
53 54
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
54 55
import eu.etaxonomy.cdm.model.reference.ReferenceType;
......
133 134
     * This may be any type listed in {@link RegistrationUIDefaults#NOMECLATURAL_PUBLICATION_UNIT_TYPES}
134 135
     * but never a {@link ReferenceType#Section}
135 136
     */
136
    private DescriptionElementSource publishedUnit;
137
    private NamedSourceBase publishedUnit;
137 138

  
138 139
    private Map<CollectionPopupEditor, SpecimenTypeDesignationDTORow> collectionPopupEditorsRowMap = new HashMap<>();
139 140

  
......
191 192
            rootEntities.add(registration);
192 193
            setInTypedesignationOnlyAct(Optional.of(Boolean.valueOf(registration.getName() == null)));
193 194
            try {
194
                DescriptionElementSource pubUnitSource = RegistrationDTO.findPublishedUnit(registration);
195
                NamedSourceBase pubUnitSource = RegistrationDTO.findPublishedUnit(registration);
195 196
                if(pubUnitSource == null) {
196 197
                    Reference reference = getRepo().getReferenceService().load(idset.getPublishedUnitUuid());
197
                    pubUnitSource = DescriptionElementSource.NewPrimarySourceInstance(reference, null);
198
                    pubUnitSource = NamedSource.NewPrimarySourceInstance(reference, null);
198 199
                }
199 200
                setPublishedUnit(pubUnitSource);
200 201
            } catch (Exception e) {
......
582 583
     * @return
583 584
     *  the {@link #publishedUnit}
584 585
     */
585
    public DescriptionElementSource getPublishedUnit() {
586
    public NamedSourceBase getPublishedUnit() {
586 587
        return publishedUnit;
587 588
    }
588 589

  
......
591 592
     *  The unit of publication in which the type designation has been published.
592 593
     *  This may be any type listed in {@link RegistrationUIDefaults#NOMECLATURAL_PUBLICATION_UNIT_TYPES}
593 594
     */
594
    protected void setPublishedUnit(DescriptionElementSource publishedUnit) throws Exception {
595
    protected void setPublishedUnit(NamedSourceBase publishedUnit) throws Exception {
595 596
        if(publishedUnit == null) {
596 597
            throw new NullPointerException();
597 598
        }

Also available in: Unified diff