Project

General

Profile

Download (22.6 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2013 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.derivateSearch;
10

    
11
import java.util.ArrayList;
12
import java.util.Collection;
13
import java.util.HashMap;
14
import java.util.HashSet;
15
import java.util.List;
16
import java.util.Map;
17
import java.util.Map.Entry;
18
import java.util.Set;
19
import java.util.UUID;
20

    
21
import org.eclipse.jface.viewers.ColumnLabelProvider;
22
import org.eclipse.jface.viewers.TreeNode;
23
import org.eclipse.swt.graphics.Image;
24
import org.hibernate.LazyInitializationException;
25

    
26
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
27
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
28
import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
29
import eu.etaxonomy.cdm.common.CdmUtils;
30
import eu.etaxonomy.cdm.format.CdmFormatterFactory;
31
import eu.etaxonomy.cdm.format.ICdmFormatter.FormatKey;
32
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
33
import eu.etaxonomy.cdm.model.common.CdmBase;
34
import eu.etaxonomy.cdm.model.common.DefinedTerm;
35
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
36
import eu.etaxonomy.cdm.model.common.Identifier;
37
import eu.etaxonomy.cdm.model.molecular.DnaSample;
38
import eu.etaxonomy.cdm.model.molecular.Sequence;
39
import eu.etaxonomy.cdm.model.molecular.SingleRead;
40
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
41
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
42
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
43
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
44
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
45
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
46
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
47
import eu.etaxonomy.taxeditor.model.ImageResources;
48
import eu.etaxonomy.taxeditor.store.CdmStore;
49

    
50
/**
51
 * Label provider for the views to show {@link SpecimenOrObservationBase}s.<br>
52
 * <br>
53
 * <b>Note:</b> If you use this label provider you need to assure that you
54
 * created a {@link ConversationHolder} resp. have an open session because
55
 * the labels are generated from various fields of the derivate hierarchy which
56
 * are lazy loaded and could therefore throw a {@link LazyInitializationException}.<br>
57
 * Use <b>{@link #setConversation(ConversationHolder)}</b> to assign the session to this provider.
58
 */
59
public class DerivateLabelProvider extends ColumnLabelProvider {
60

    
61
    private static final String NO_SAMPLE_DESIGNATION = "[no sample designation]";
62

    
63
    private static Set<SingleRead> multiLinkSingleReads;
64

    
65
    private static Map<DerivedUnit, Collection<SpecimenTypeDesignation>> typeDesignations;
66

    
67
    private ConversationHolder conversation;
68

    
69
    private static DefinedTerm photoTerm = null;
70
    private static DefinedTerm drawingTerm = null;
71
    private static DefinedTerm specimenScanTerm = null;
72
    private static DefinedTerm detailImageTerm = null;
73
    private static DefinedTerm sampleDesignationTerm = null;
74

    
75
    //FIXME: move static term getters to new singleton utility class
76
    private static void initializeTerms() {
77
        List<DefinedTerm> preferredTerms = CdmStore.getTermManager().getPreferredTerms(DefinedTerm.class);
78
        for (DefinedTerm definedTerm : preferredTerms) {
79
            if(definedTerm.getUuid().equals(UUID.fromString("c5c59c42-f254-471e-96c6-09f459f7c903"))){
80
                photoTerm = definedTerm;
81
            }
82
            else if(definedTerm.getUuid().equals(UUID.fromString("669b0409-4aa4-4695-aae4-a95ed27bad4c"))){
83
                drawingTerm = definedTerm;
84
            }
85
            else if(definedTerm.getUuid().equals(UUID.fromString("acda15be-c0e2-4ea8-8783-b9b0c4ad7f03"))){
86
                specimenScanTerm = definedTerm;
87
            }
88
            else if(definedTerm.getUuid().equals(UUID.fromString("31eb8d02-bf5d-437c-bcc6-87a626445f34"))){
89
                detailImageTerm = definedTerm;
90
            }
91
            else if(definedTerm.getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
92
                sampleDesignationTerm = definedTerm;
93
            }
94
        }
95
    }
96

    
97
    public static DefinedTerm getLivingPlantPhotoTerm(){
98
        if(photoTerm==null){
99
            initializeTerms();
100
        }
101
        return photoTerm;
102
    }
103

    
104
    public static DefinedTerm getArtworkTerm(){
105
        if(drawingTerm==null){
106
            initializeTerms();
107
        }
108
        return drawingTerm;
109
    }
110

    
111
    public static DefinedTerm getSpecimenScanTerm(){
112
        if(specimenScanTerm==null){
113
            initializeTerms();
114
        }
115
        return specimenScanTerm;
116
    }
117

    
118
    public static DefinedTerm getDetailImageTerm(){
119
        if(detailImageTerm==null){
120
            initializeTerms();
121
        }
122
        return detailImageTerm;
123
    }
124

    
125
    public static DefinedTerm getSampleDesignationTerm(){
126
        if(sampleDesignationTerm==null){
127
            initializeTerms();
128
        }
129
        return sampleDesignationTerm;
130
    }
131

    
132

    
133
    /** {@inheritDoc} */
134
    @Override
135
    public String getText(Object element) {
136
        if(element instanceof TreeNode){
137
            element = ((TreeNode) element).getValue();
138
        }
139
        FormatKey[] formatKeys = {
140
                FormatKey.GATHERING_COUNTRY, FormatKey.SPACE,
141
                FormatKey.GATHERING_LOCALITY_TEXT, FormatKey.SPACE,
142
                FormatKey.GATHERING_DATE, FormatKey.SPACE,
143
                FormatKey.GATHERING_COLLECTOR, FormatKey.SPACE,
144
                FormatKey.FIELD_NUMBER, FormatKey.SPACE,
145
                FormatKey.COLLECTION_CODE, FormatKey.SPACE,
146
                FormatKey.MOST_SIGNIFICANT_IDENTIFIER, FormatKey.SPACE,
147
//                FormatKey.KIND_OF_UNIT, FormatKey.SPACE,
148
                FormatKey.SAMPLE_DESIGNATION, FormatKey.SPACE,
149
                FormatKey.SINGLE_READ_PRIMER, FormatKey.SPACE,
150
                FormatKey.SEQUENCE_DNA_MARKER, FormatKey.SPACE,
151
                FormatKey.AMPLIFICATION_LABEL, FormatKey.SPACE,
152
                FormatKey.MEDIA_TITLE, FormatKey.SPACE,
153
                FormatKey.MEDIA_ARTIST, FormatKey.SPACE
154
        };
155
        String text = CdmFormatterFactory.format(element, formatKeys);
156
        if(element instanceof IdentifiableEntity){
157
        	IdentifiableEntity identifiableEntity = (IdentifiableEntity) element;
158
        	if(identifiableEntity.isProtectedTitleCache()){
159
        		text = identifiableEntity.getTitleCache();
160
        	}
161
        }
162
        if(CdmUtils.isBlank(text)){
163
        	return "[-]";
164
        }
165
		return text;
166
    }
167

    
168
    /** {@inheritDoc} */
169
    @Override
170
    public String getToolTipText(Object element) {
171
        return getDerivateText(element);
172
    }
173

    
174
    /**
175
     * @param conversation the conversation to set
176
     */
177
    public void setConversation(ConversationHolder conversation) {
178
        this.conversation = conversation;
179
    }
180

    
181
    public String getDerivateText(Object element){
182
        return getDerivateText(element, conversation);
183
    }
184

    
185
    public static String getDerivateText(Object element, ConversationHolder conversation){
186
        //TODO: use list of strings to assemble labels to avoid adding the separator every time and to allow null values
187
        TreeNode parentNode = null;
188
        TreeNode node = null;
189
        Object derivate = element;
190
        if(element instanceof TreeNode){
191
            node = (TreeNode) element;
192
            parentNode = node.getParent();
193
            //unwrap specimen from TreeNode
194
            derivate = node.getValue();
195
        }
196

    
197
        if(conversation!=null){
198
            conversation.bind();
199
        }
200

    
201
        final String emptyString = "";
202
        final String separator = " ";
203

    
204
        String label = emptyString;
205

    
206
        //Field Unit
207
        if(derivate instanceof FieldUnit){
208
            FieldUnit fieldUnit = (FieldUnit)derivate;
209
            if(fieldUnit.getGatheringEvent()!=null){
210
                GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
211
                label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+separator:emptyString;
212
                label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+separator:emptyString;
213
                label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+separator:emptyString;
214
                label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
215
            }
216
            label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber():emptyString;
217
        }
218
        //MediaSpecimen
219
        else if(derivate instanceof MediaSpecimen){
220
            MediaSpecimen mediaSpecimen = (MediaSpecimen)derivate;
221
            if(mediaSpecimen.getMediaSpecimen()!=null){
222
                label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+separator:"[no motif]";
223
                label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+separator:emptyString;
224
            }
225
            eu.etaxonomy.cdm.model.occurrence.Collection collection = mediaSpecimen.getCollection();
226
            if(collection!=null){
227
                label += collection.getName()!=null?collection.getName()+" ":emptyString;
228
                label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
229
            }
230
            label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+separator:emptyString;
231
            label += mediaSpecimen.getBarcode()!=null?mediaSpecimen.getBarcode()+separator:emptyString;
232
        }
233
        //TissueSample + DnaSample
234
        else if(derivate instanceof DnaSample){
235
            DnaSample dnaSample = (DnaSample)derivate;
236
            if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
237
                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
238
                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
239
                    label += currentSampleDesignation.getIdentifier()+separator;
240
                }
241
                else{
242
                    label += NO_SAMPLE_DESIGNATION+separator;
243
                }
244
            }
245
            else if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.TissueSample){
246
                if(dnaSample.getKindOfUnit()!=null){
247
                    label += dnaSample.getKindOfUnit()+separator;
248
                }
249
                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
250
                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
251
                    label += currentSampleDesignation.getIdentifier()+separator;
252
                }
253
                else{
254
                    label += NO_SAMPLE_DESIGNATION+separator;
255
                }
256
            }
257

    
258
        }
259
        //DerivedUnit + TissueSample
260
        else if(derivate instanceof DerivedUnit){
261
            DerivedUnit derivedUnit = (DerivedUnit)derivate;
262
            if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
263
                //check for type designation
264
                if(typeDesignations.get(derivedUnit)==null){
265
                    for (SpecimenTypeDesignation specimenTypeDesignation : CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnit, null, null, null, null)) {
266
                        addTypeDesignation(derivedUnit, specimenTypeDesignation);
267
                    }
268
                }
269
                //java.util.Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(derivedUnit.getUuid());
270
                //TODO : This is not generic anymore for performance reasons
271
                Set<SpecimenOrObservationBase> originals = derivedUnit.getOriginals();
272
                if(originals!=null && originals.size() ==1) {
273
                    SpecimenOrObservationBase specimen = originals.iterator().next();
274
                    if(specimen instanceof FieldUnit) {
275
                        FieldUnit fieldUnit = (FieldUnit)specimen;
276
                        GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
277
                        if(gatheringEvent!=null){
278
                            label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
279
                        }
280
                        label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+separator:emptyString;
281
                    }
282
                }
283

    
284
                eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
285
                if(collection!=null){
286
                    label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
287
                }
288
                String mostSignificantIdentifier = derivedUnit.getMostSignificantIdentifier();
289
                label += mostSignificantIdentifier!=null?mostSignificantIdentifier+separator:emptyString;
290
            }
291
            else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
292
                //TissueSample should only be created by using it's own class
293
                //in future using only one class with different SpecimenOrObservationTypes is desired
294
//                label += derivedUnit.getKindOfUnit() + NO_SAMPLE_DESIGNATION;
295
            }
296
        }
297
        //Sequence
298
        else if(derivate instanceof Sequence){
299
            Sequence sequence = (Sequence)derivate;
300
            Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
301
            if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
302
                label += currentSampleDesignation.getIdentifier()+separator;
303
            }
304
            else{
305
                label += NO_SAMPLE_DESIGNATION+separator;
306
            }
307
            label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():emptyString;
308
        }
309
        //SingleRead
310
        else if(derivate instanceof SingleRead){
311
            SingleRead singleRead = (SingleRead)derivate;
312
            if(parentNode!=null && parentNode.getValue() instanceof Sequence){
313
                Sequence sequence = (Sequence) parentNode.getValue();
314
                Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
315
                if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
316
                    label = currentSampleDesignation.getIdentifier()+separator;
317
                }
318
                else{
319
                    label += NO_SAMPLE_DESIGNATION+separator;
320
                }
321
                label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+separator:emptyString;
322
                if(sequence!=null && sequence.getDnaMarker()!=null){
323
                    label += sequence.getDnaMarker()+separator;
324
                }
325
                if(singleRead.getAmplificationResult()!=null && singleRead.getAmplificationResult().getAmplification()!=null){
326
                    label += singleRead.getAmplificationResult().getAmplification().getLabelCache()+separator;
327
                }
328
            }
329
        }
330
        //SOOB
331
        else if(derivate instanceof SpecimenOrObservationBase){
332
            SpecimenOrObservationBase<?> specimen = (SpecimenOrObservationBase<?>) derivate;
333
            SpecimenOrObservationType type = specimen.getRecordBasis();
334
            return specimen.getTitleCache() + (type!=null?" ["+type.toString()+"]":emptyString);
335
        }
336
        if(label.isEmpty()){
337
            label = derivate.toString();
338
        }
339
        //remove last comma
340
        else if(label.endsWith(separator)){
341
            label = label.substring(0, label.length()-separator.length());
342
        }
343
        return label;
344
    }
345

    
346
    @Override
347
    public Image getImage(Object element) {
348
        if(element instanceof TreeNode){
349
            element = ((TreeNode) element).getValue();
350
        }
351
        if(element instanceof CdmBase){
352
            CdmBase cdmBase = (CdmBase)element;
353
            boolean hasCharacterData = false;
354
            if(cdmBase.isInstanceOf(SpecimenOrObservationBase.class)){
355
                SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(cdmBase, SpecimenOrObservationBase.class);
356
                if(specimen.hasCharacterData()){
357
                    hasCharacterData = true;
358
                }
359
            }
360
            if(cdmBase.isInstanceOf(FieldUnit.class)){
361
                return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
362
            }
363
            else if(cdmBase.isInstanceOf(DerivedUnit.class)){
364
                DerivedUnit derivedUnit = HibernateProxyHelper.deproxy(element, DerivedUnit.class);
365

    
366
                if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
367
                    return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
368
                }
369
                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.DnaSample){
370
                    return hasCharacterData?ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE);
371
                }
372
                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
373
                    return hasCharacterData?ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE);
374
                }
375
                else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
376
                    if(typeDesignations.get(derivedUnit)!=null && !typeDesignations.get(derivedUnit).isEmpty()){
377
                        return ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_TYPE);
378
                    }
379
                    return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE);
380
                }
381
                else if(derivedUnit.getRecordBasis().isMedia()
382
                        || derivedUnit.getRecordBasis().isKindOf(SpecimenOrObservationType.Media)){
383
                    if(derivedUnit.getKindOfUnit()!=null){
384
                        if(derivedUnit.getKindOfUnit().equals(getArtworkTerm())){
385
                            return hasCharacterData?ImageResources.getImage(ImageResources.ARTWORK_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.ARTWORK_DERIVATE);
386
                        }
387
                        else if(derivedUnit.getKindOfUnit().equals(getLivingPlantPhotoTerm())){
388
                            return hasCharacterData?ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE);
389
                        }
390
                        else if(derivedUnit.getKindOfUnit().equals(getSpecimenScanTerm())){
391
                            return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE);
392
                        }
393
                        else if(derivedUnit.getKindOfUnit().equals(getDetailImageTerm())){
394
                            return hasCharacterData?ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE);
395
                        }
396
                    }
397
                }
398
            }
399
            else if(cdmBase.isInstanceOf(Sequence.class)){
400
                return ImageResources.getImage(ImageResources.SEQUENCE_DERIVATE);
401
            }
402

    
403
            else if(cdmBase.isInstanceOf(SingleRead.class)){
404
                if(multiLinkSingleReads!=null && multiLinkSingleReads.contains(element)){
405
                    return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE_MULTILINK);
406
                }
407
                else{
408
                    return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE);
409
                }
410
            }
411
        }
412
        return ImageResources.getImage(ImageResources.DEFAULT_DERIVATIVE);
413
    }
414

    
415
    public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
416
        if(entity.isInstanceOf(DnaSample.class)){
417
            DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class);
418
            for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
419
                if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
420
                    //first sample designation is the current
421
                    return identifier;
422
                }
423
            }
424
        }
425
        else if(entity.isInstanceOf(Sequence.class)){
426
            Sequence sequence = HibernateProxyHelper.deproxy(entity, Sequence.class);
427
            if(sequence.getDnaSample()!=null){
428
                return getCurrentSampleDesignation(sequence.getDnaSample());
429
            }
430
        }
431
        return null;
432
    }
433

    
434
    private static void addTypeDesignation(DerivedUnit derivedUnit, SpecimenTypeDesignation typeDesignation){
435
        Collection<SpecimenTypeDesignation> list = typeDesignations.get(derivedUnit);
436
        if(list==null){
437
            list = new ArrayList<SpecimenTypeDesignation>();
438
        }
439
        list.add(typeDesignation);
440
        typeDesignations.put(derivedUnit, list);
441
    }
442

    
443
    public static Set<SingleRead> getMultiLinkSingleReads() {
444
        return multiLinkSingleReads;
445
    }
446

    
447
    public void updateLabelCache(Collection<SpecimenOrObservationBase<?>> rootElements) {
448
        multiLinkSingleReads = new HashSet<SingleRead>();
449
        typeDesignations = new HashMap<DerivedUnit, Collection<SpecimenTypeDesignation>>();
450
        for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
451
            if(entry.getValue().size()>1){
452
                multiLinkSingleReads.add(entry.getKey());
453
            }
454
        }
455
        if(rootElements!=null){
456
            Collection<DerivedUnit> derivedUnits = new ArrayList<DerivedUnit>();
457
            for (SpecimenOrObservationBase specimenOrObservationBase : rootElements) {
458
                derivedUnits.addAll(CdmStore.getService(IOccurrenceService.class).getAllChildDerivatives(specimenOrObservationBase.getUuid()));
459
                if(specimenOrObservationBase.isInstanceOf(DerivedUnit.class)){
460
                    derivedUnits.add(HibernateProxyHelper.deproxy(specimenOrObservationBase, DerivedUnit.class));
461
                }
462
            }
463
            typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(derivedUnits, null, null, null, null);
464
        }
465
    }
466

    
467
}
(2-2/2)