Project

General

Profile

« Previous | Next » 

Revision cfabbeb0

Added by Andreas Kohlbecker almost 7 years ago

ref #6724 SpecimenTypeDesignationWorkingsetEditor improvements

  • better country select item captions
  • extending the SpecimenTypeDesignationWorkingSetDTO
  • adding more fields to the editor
  • Custom component for the min-max-freetext fields like 'Absolute elevation'

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java
13 13

  
14 14
import org.joda.time.Partial;
15 15

  
16
import eu.etaxonomy.cdm.model.agent.Person;
16
import eu.etaxonomy.cdm.model.agent.AgentBase;
17
import eu.etaxonomy.cdm.model.common.Language;
17 18
import eu.etaxonomy.cdm.model.common.LanguageString;
18 19
import eu.etaxonomy.cdm.model.common.VersionableEntity;
19 20
import eu.etaxonomy.cdm.model.location.NamedArea;
21
import eu.etaxonomy.cdm.model.location.Point;
20 22
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
21 23
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
24
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
22 25

  
23 26
/**
24 27
 * @author a.kohlbecker
......
45 48
        this.baseEntity = baseEntity;
46 49
        if(baseEntity instanceof FieldUnit){
47 50
            this.fieldUnit = (FieldUnit) baseEntity;
51
            if(fieldUnit.getGatheringEvent() == null){
52
                fieldUnit.setGatheringEvent(GatheringEvent.NewInstance());
53
            }
48 54
        }
49 55
        this.specimenTypeDesignations = specimenTypeDesignations;
50 56
    }
......
85 91
    }
86 92

  
87 93
    // ====== FieldUnit Wrapper methods ====== //
88
    public Person getPrimaryCollector() {
89
        return fieldUnit.getPrimaryCollector();
90
    }
94

  
91 95

  
92 96
    public String getFieldNumber() {
93 97
        return fieldUnit.getFieldNumber();
......
103 107

  
104 108
    // ====== GateringEvent Wrapper methods ====== //
105 109

  
106
    public LanguageString getLocality(){
107
        return fieldUnit.getGatheringEvent().getLocality();
110
    public String getLocality(){
111
        if(fieldUnit.getGatheringEvent().getLocality() != null){
112
            return fieldUnit.getGatheringEvent().getLocality().getText();
113
        }
114
        return null;
108 115
    }
109 116

  
110
    public void setLocality(LanguageString locality){
111
        fieldUnit.getGatheringEvent().setLocality(locality);
117
    public void setLocality(String locality){
118
        fieldUnit.getGatheringEvent().setLocality(
119
                LanguageString.NewInstance(locality, Language.DEFAULT())
120
                );
112 121
    }
113 122
    public NamedArea getCountry() {
114 123
        return fieldUnit.getGatheringEvent().getCountry();
......
118 127
        fieldUnit.getGatheringEvent().setCountry(country);
119 128
    }
120 129

  
130
    public Point getExactLocation() {
131
        return fieldUnit.getGatheringEvent().getExactLocation();
132
    }
133

  
134
    public void setExactLocation(Point exactLocation) {
135
        fieldUnit.getGatheringEvent().setExactLocation(exactLocation);
136
    }
137

  
121 138
    public Integer getAbsoluteElevation() {
122 139
        return fieldUnit.getGatheringEvent().getAbsoluteElevation();
123 140
    }
......
187 204
        return fieldUnit.getGatheringEvent().getDistanceToGroundText();
188 205
    }
189 206

  
207
    public AgentBase getCollector(){
208
        return fieldUnit.getGatheringEvent().getActor();
209
    }
210

  
211
    public void setCollector(AgentBase collector){
212
        fieldUnit.getGatheringEvent().setActor(collector);
213
    }
214

  
190 215
    public void setDistanceToGroundText(String distanceToGroundText) {
191 216
        fieldUnit.getGatheringEvent().setDistanceToWaterSurfaceText(distanceToGroundText);
192 217
    }

Also available in: Unified diff