Project

General

Profile

« Previous | Next » 

Revision e3820923

Added by Andreas Kohlbecker over 2 years ago

adding again full ReferenceDTO to SourceDTO as the data portal needs more data

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/SourceDTO.java
14 14
import eu.etaxonomy.cdm.format.reference.OriginalSourceFormatter;
15 15
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
16 16
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
17
import eu.etaxonomy.cdm.model.reference.Reference;
18
import eu.etaxonomy.cdm.ref.TypedEntityReference;
19 17

  
20 18
/**
21 19
 * @author a.kohlbecker
......
28 26
    private UUID uuid;
29 27
    protected String label;
30 28
    String citationDetail;
31
    TypedEntityReference<Reference> citation;
29
    // can not reduce to TypedEntityReference here since the data portal requires
30
    // doi, uri, etc, see function cdm_reference_markup() in cdm_dataportal
31
    ReferenceDTO citation;
32 32

  
33 33
    public static SourceDTO fromDescriptionElementSource(NamedSourceBase entity) {
34 34
        if(entity == null) {
......
37 37
        SourceDTO dto = new SourceDTO();
38 38
        dto.uuid = entity.getUuid();
39 39
        dto.label = OriginalSourceFormatter.INSTANCE.format(entity);
40
        dto.citation = TypedEntityReference.fromEntity(entity.getCitation(), false);
40
        dto.citation = ReferenceDTO.fromReference(entity.getCitation());
41 41
        dto.citationDetail = entity.getCitationMicroReference();
42 42
        return dto;
43 43
    }
......
63 63
        this.uuid = uuid;
64 64
    }
65 65

  
66
    public TypedEntityReference<Reference> getCitation() {
66
    public ReferenceDTO getCitation() {
67 67
        return citation;
68 68
    }
69 69

  
70 70

  
71
    public void setCitation(TypedEntityReference<Reference> citation) {
71
    public void setCitation(ReferenceDTO citation) {
72 72
        this.citation = citation;
73 73
    }
74 74

  

Also available in: Unified diff