use of com.odysseusinc.arachne.commons.api.v1.dto.CommonArachneUserDTO in project ArachneCentralAPI by OHDSI.
the class UserToCommonArachneUserDTOConverter method convert.
@Override
public CommonArachneUserDTO convert(IUser user) {
final CommonArachneUserDTO dto = new CommonArachneUserDTO();
dto.setFirstName(user.getFirstname());
dto.setLastName(user.getLastname());
dto.setLogin(user.getUsername());
dto.setType(CommonArachneUserTypeDTO.PORTAL);
return dto;
}
use of com.odysseusinc.arachne.commons.api.v1.dto.CommonArachneUserDTO in project ArachneCentralAPI by OHDSI.
the class BaseSubmissionToCommonAnalysisDTOConverter method convert.
@Override
public CommonAnalysisDTO convert(T source) {
final CommonAnalysisDTO dto = createResultObject();
dto.setId(source.getId());
final Analysis analysis = source.getSubmissionGroup().getAnalysis();
if (analysis != null) {
dto.setName(analysis.getTitle());
dto.setType(analysis.getType());
Study study = analysis.getStudy();
if (study != null && conversionService.canConvert(study.getClass(), CommonStudyDTO.class)) {
dto.setStudy(conversionService.convert(study, CommonStudyDTO.class));
}
}
IUser author = source.getSubmissionGroup().getAuthor();
if (author != null && conversionService.canConvert(author.getClass(), CommonArachneUserDTO.class)) {
CommonArachneUserDTO userDTO = conversionService.convert(author, CommonArachneUserDTO.class);
dto.setOwner(userDTO);
}
dto.setUpdateSubmissionStatusPassword(source.getUpdatePassword());
dto.setCentralDataSourceId(source.getDataSource().getId());
for (SubmissionFile submissionFile : source.getSubmissionGroup().getFiles()) {
if (submissionFile.getExecutable() && StringUtils.isEmpty(dto.getExecutableFileName())) {
dto.setExecutableFileName(submissionFile.getRealName());
dto.setInnerExecutableFilename(submissionFile.getEntryPoint());
}
}
dto.setAnalysisFiles(source.getSubmissionGroup().getFiles().stream().map(file -> conversionService.convert(file, CommonAnalysisFileDTO.class)).collect(Collectors.toList()));
proceedAdditionalFields(dto, source);
return dto;
}
Aggregations