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;
}
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);
}
Aggregations