Search in sources :

Example 6 with FileDTO

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

Example 7 with 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;
}
Also used : FileDTO(com.odysseusinc.arachne.portal.api.v1.dto.FileDTO) ResultFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.ResultFileDTO) ResultFileDTO(com.odysseusinc.arachne.portal.api.v1.dto.ResultFileDTO)

Aggregations

FileDTO (com.odysseusinc.arachne.portal.api.v1.dto.FileDTO)5 ApiOperation (io.swagger.annotations.ApiOperation)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)2 SubmissionFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionFileDTO)2 UploadFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.UploadFileDTO)2 PaperFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.PaperFileDTO)1 ResultFileDTO (com.odysseusinc.arachne.portal.api.v1.dto.ResultFileDTO)1 UpdateNotificationDTO (com.odysseusinc.arachne.portal.api.v1.dto.UpdateNotificationDTO)1 UserInfoDTO (com.odysseusinc.arachne.portal.api.v1.dto.UserInfoDTO)1 AlreadyExistException (com.odysseusinc.arachne.portal.exception.AlreadyExistException)1 AbstractPaperFile (com.odysseusinc.arachne.portal.model.AbstractPaperFile)1 AnalysisUnlockRequest (com.odysseusinc.arachne.portal.model.AnalysisUnlockRequest)1 IUser (com.odysseusinc.arachne.portal.model.IUser)1 StudyFile (com.odysseusinc.arachne.portal.model.StudyFile)1 SubmissionFile (com.odysseusinc.arachne.portal.model.SubmissionFile)1 Date (java.util.Date)1 GET (org.springframework.web.bind.annotation.RequestMethod.GET)1 POST (org.springframework.web.bind.annotation.RequestMethod.POST)1 PUT (org.springframework.web.bind.annotation.RequestMethod.PUT)1