Search in sources :

Example 1 with SubmissionFileDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO in project ArachneCentralAPI by OHDSI.

the class SubmissionFileToSubmissionFileDTOConverter method convert.

@Override
public SubmissionFileDTO convert(SubmissionFile source) {
    FileDTO fileDTO = conversionService.convert(source, FileDTO.class);
    fileDTO.setFileId(source.getId());
    SubmissionFileDTO submissionFileDTO = new SubmissionFileDTO();
    BeanUtils.copyProperties(fileDTO, submissionFileDTO);
    submissionFileDTO.setLabel(source.getLabel());
    submissionFileDTO.setVersion(source.getVersion());
    submissionFileDTO.setChecksum(source.getChecksum());
    return submissionFileDTO;
}
Also used : FileDTO(com.odysseusinc.arachne.portal.api.v1.dto.FileDTO) SubmissionFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO) SubmissionFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO)

Example 2 with SubmissionFileDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO in project ArachneCentralAPI by OHDSI.

the class BaseSubmissionController method getSubmissionGroupFileInfo.

@ApiOperation("Get query file of the submission group.")
@RequestMapping(value = "/api/v1/analysis-management/submission-groups/{submissionGroupId}/files/{fileId}", method = GET)
public JsonResult<SubmissionFileDTO> getSubmissionGroupFileInfo(@PathVariable("submissionGroupId") Long submissionGroupId, @PathVariable("fileId") Long fileId, @RequestParam(defaultValue = "true") Boolean withContent) throws NotExistException, IOException {
    final SubmissionFile submissionFile = submissionService.getSubmissionFile(submissionGroupId, fileId);
    SubmissionFileDTO fileDto = conversionService.convert(submissionFile, SubmissionFileDTO.class);
    if (withContent) {
        fileDto = (SubmissionFileDTO) FileDtoContentHandler.getInstance(fileDto, analysisService.getPath(submissionFile).toFile()).withPdfConverter(toPdfConverter::convert).handle();
    }
    return new JsonResult<>(NO_ERROR, fileDto);
}
Also used : SubmissionFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO) JsonResult(com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult) SubmissionFile(com.odysseusinc.arachne.portal.model.SubmissionFile) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

SubmissionFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO)2 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)1 FileDTO (com.odysseusinc.arachne.portal.api.v1.dto.FileDTO)1 SubmissionFile (com.odysseusinc.arachne.portal.model.SubmissionFile)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1