use of com.odysseusinc.arachne.portal.api.v1.dto.FileDTO 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);
}
use of com.odysseusinc.arachne.portal.api.v1.dto.FileDTO in project ArachneCentralAPI by OHDSI.
the class ArachneFileMetaToResultFileDTOConverter method convert.
@Override
public ResultFileDTO convert(ArachneFileMeta source) {
FileDTO fileDTO = conversionService.convert(source, FileDTO.class);
ResultFileDTO resultFileDTO = new ResultFileDTO(fileDTO);
resultFileDTO.setManuallyUploaded(source.getCreatedBy() != null);
return resultFileDTO;
}
Aggregations