Project

General

Profile

Revision 3f6d782a

ID3f6d782ae7f64a08982ceecaf218980846e6b751
Parent 59d36b0c
Child f710aa8b

Added by Katja Luther over 2 years ago

ref #7599: further improvement for specimenDtos

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/GatheringEventDTO.java
15 15
import eu.etaxonomy.cdm.model.location.NamedArea;
16 16
import eu.etaxonomy.cdm.model.location.Point;
17 17
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
18
import eu.etaxonomy.cdm.persistence.dto.TermDto;
19 18

  
20 19
/**
21 20
 * @author k.luther
......
27 26
    private String locality;
28 27
    private Point exactLocation;
29 28
    private String country;
30
    private Set<TermDto> collectingAreas;
29
    private Set<String> collectingAreas;
31 30
    private String collectingMethod;
32 31
    private Integer absoluteElevation;
33 32
    private Integer absoluteElevationMax;
......
55 54
     * @param distanceToWaterSurfaceMax
56 55
     * @param distanceToWaterSurfaceText
57 56
     */
58
    public GatheringEventDTO(String locality, Point exactLocation, String country, Set<TermDto> collectingAreas,
57
    public GatheringEventDTO(String locality, Point exactLocation, String country, Set<String> collectingAreas,
59 58
            String collectingMethod, String collector, Integer absoluteElevation, Integer absoluteElevationMax,
60 59
            String absoluteElevationText, Double distanceToGround, Double distanceToGroundMax,
61 60
            String distanceToGroundText, Double distanceToWaterSurface, Double distanceToWaterSurfaceMax,
......
131 130
        }
132 131

  
133 132
        for (NamedArea area: gathering.getCollectingAreas()){
134
            TermDto areaDto = TermDto.fromNamedArea(area);
133
            String areaString = area.getLabel();
135 134
            if (dto.getCollectingAreas() == null){
136 135
                dto.collectingAreas = new HashSet<>();
137 136
            }
138
            dto.collectingAreas.add(areaDto);
137
            dto.collectingAreas.add(areaString);
139 138
        }
140 139

  
141 140
        return dto;
......
151 150
    public String getCountry() {
152 151
        return country;
153 152
    }
154
    public Set<TermDto> getCollectingAreas() {
153
    public Set<String> getCollectingAreas() {
155 154
        return collectingAreas;
156 155
    }
157 156
    public String getCollectingMethod() {
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/PreservedSpecimenDTO.java
74 74
     */
75 75
    public PreservedSpecimenDTO(DerivedUnit derivedUnit) {
76 76
        super(derivedUnit);
77
    }
78

  
79
    public static PreservedSpecimenDTO newInstance(DerivedUnit derivedUnit){
80
        PreservedSpecimenDTO newInstance = new PreservedSpecimenDTO(derivedUnit);
81

  
82
//        newInstance.setTitleCache(derivedUnit.getTitleCache());
83

  
84
        newInstance.accessionNumber = derivedUnit.getAccessionNumber();
85
        newInstance.preferredStableUri = derivedUnit.getPreferredStableUri();
77
        accessionNumber = derivedUnit.getAccessionNumber();
78
        preferredStableUri = derivedUnit.getPreferredStableUri();
86 79
        if (derivedUnit.getCollection() != null){
87
            newInstance.setCollectioDTo(new CollectionDTO(HibernateProxyHelper.deproxy(derivedUnit.getCollection())));
80
            setCollectioDTo(new CollectionDTO(HibernateProxyHelper.deproxy(derivedUnit.getCollection())));
88 81
        }
89
        newInstance.setBarcode(derivedUnit.getBarcode());
90
        newInstance.setCatalogNumber(derivedUnit.getCatalogNumber());
91
        newInstance.listLabel = derivedUnit.getCatalogNumber();
92
        newInstance.setCollectorsNumber(derivedUnit.getCollectorsNumber());
82
        setBarcode(derivedUnit.getBarcode());
83
        setCatalogNumber(derivedUnit.getCatalogNumber());
84
        listLabel = derivedUnit.getCatalogNumber();
85
        setCollectorsNumber(derivedUnit.getCollectorsNumber());
93 86
        if (derivedUnit.getDerivedFrom() != null){
94
            newInstance.setDerivationEvent(new DerivationEventDTO(derivedUnit.getDerivedFrom() ));
87
            setDerivationEvent(new DerivationEventDTO(derivedUnit.getDerivedFrom() ));
95 88
        }
96 89
        if (derivedUnit.getPreservation()!= null){
97
            newInstance.setPreservationMethod(derivedUnit.getPreservation().getMaterialMethodText());
90
            setPreservationMethod(derivedUnit.getPreservation().getMaterialMethodText());
98 91
        }
99
        newInstance.setRecordBase(derivedUnit.getRecordBasis().getMessage());
100
        newInstance.setSources(derivedUnit.getSources());
101
        newInstance.setSpecimenTypeDesignations(derivedUnit.getSpecimenTypeDesignations());
102

  
103
        return newInstance;
92
        setRecordBase(derivedUnit.getRecordBasis().getMessage());
93
        setSources(derivedUnit.getSources());
94
        setSpecimenTypeDesignations(derivedUnit.getSpecimenTypeDesignations());
104 95
    }
105 96

  
97

  
98

  
106 99
    public String getAccessionNumber() {
107 100
        return accessionNumber;
108 101
    }
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/SequenceDTO.java
13 13
import java.util.HashSet;
14 14
import java.util.Set;
15 15

  
16
import eu.etaxonomy.cdm.model.common.DefinedTerm;
17 16
import eu.etaxonomy.cdm.model.media.Media;
18 17
import eu.etaxonomy.cdm.model.molecular.Sequence;
19 18
import eu.etaxonomy.cdm.model.molecular.SequenceString;
......
29 28

  
30 29
    private Media contigFile;
31 30

  
32
    private SequenceString consensusSequence = SequenceString.NewInstance();
31
    private SequenceString consensusSequence;
33 32

  
34 33

  
35 34
    private Boolean isBarcode = null;
......
47 46
    private Set<SingleReadAlignment> singleReadAlignments = new HashSet<SingleReadAlignment>();
48 47

  
49 48

  
50
    private DefinedTerm dnaMarker;
49
    private String dnaMarker;
51 50

  
52 51

  
53 52

  
......
69 68
        geneticAccessionNumber = seq.getGeneticAccessionNumber();
70 69
        boldProcessId = seq.getBoldProcessId();
71 70
        singleReadAlignments = seq.getSingleReadAlignments();
72
        dnaMarker = seq.getDnaMarker();
71
        dnaMarker = seq.getDnaMarker().getLabel();
73 72
        haplotype = seq.getHaplotype();
74 73
        citations = seq.getCitations();
75 74
        try{
......
176 175
    /**
177 176
     * @return the dnaMarker
178 177
     */
179
    public DefinedTerm getDnaMarker() {
178
    public String getDnaMarker() {
180 179
        return dnaMarker;
181 180
    }
182 181

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)