Project

General

Profile

Revision a4959ee4

IDa4959ee4938d2ee2ab741aef59f7dbc57eabde59
Parent 370fff82
Child 6ffe25c9

Added by Andreas Kohlbecker over 2 years ago

ref #7977 OccurrencePortalController: mediaSpecimens with complete sources

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/OccurrencePortalController.java
29 29
import eu.etaxonomy.cdm.api.service.ITermService;
30 30
import eu.etaxonomy.cdm.api.service.dto.FieldUnitDTO;
31 31
import eu.etaxonomy.cdm.api.service.dto.PreservedSpecimenDTO;
32
import eu.etaxonomy.cdm.model.media.Media;
32 33
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
33 34
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
35
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
34 36
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
35 37
import io.swagger.annotations.Api;
36 38

  
......
135 137
        return null;
136 138
    }
137 139

  
140
    @RequestMapping(value = { "mediaSpecimen" }, method = RequestMethod.GET)
141
    public Media doGetMediaSpecimen(
142
            @PathVariable("uuid") UUID uuid,
143
            HttpServletRequest request,
144
            HttpServletResponse response) throws IOException {
145

  
146
        logger.info("doGetMediaSpecimen() " + requestPathAndQuery(request));
147

  
148

  
149
        SpecimenOrObservationBase sob = service.load(uuid, Arrays.asList("mediaSpecimen.sources.citation", "mediaSpecimen.representations.parts"));
150
        if(sob instanceof MediaSpecimen){
151
            MediaSpecimen mediaSpecimen = (MediaSpecimen) sob;
152
            if(mediaSpecimen.isPublish()){
153
                return mediaSpecimen.getMediaSpecimen();
154
            }
155
        }
156
        return null;
157
    }
158

  
138 159
//    @RequestMapping(value = { "specimenDerivatesAndOriginals" }, method = RequestMethod.GET)
139 160
//    public ModelAndView doGetSpecimenDerivatesAndOriginals(
140 161
//            @RequestParam(value = "relationships", required = false) UuidList relationshipUuids,

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)