use of com.odysseusinc.arachne.portal.api.v1.dto.DataNodeDTO in project ArachneCentralAPI by OHDSI.
the class DataSourceToDataSourceDTOConverter method proceedAdditionalFields.
@Override
protected void proceedAdditionalFields(DataSourceDTO dataSourceDTO, IDataSource dataSource) {
final CommonHealthStatus healthStatus = dataSource.getHealthStatus();
dataSourceDTO.setHealthStatus(healthStatus);
dataSourceDTO.setHealthStatusTitle(healthStatus.toString());
dataSourceDTO.setDeleted(dataSource.getDeleted());
DataNodeDTO dataNodeDTO = conversionService.convert(dataSource.getDataNode(), DataNodeDTO.class);
dataSourceDTO.setDataNode(dataNodeDTO);
dataSourceDTO.setPermissions(conversionService.convert(dataSource, PermissionsDTO.class));
}
use of com.odysseusinc.arachne.portal.api.v1.dto.DataNodeDTO in project ArachneCentralAPI by OHDSI.
the class DataNodeToDataNodeDTOConverter method convert.
@Override
public DataNodeDTO convert(DataNode dataNode) {
final DataNodeDTO dataNodeDTO = new DataNodeDTO();
dataNodeDTO.setId(dataNode.getId());
dataNodeDTO.setName(dataNode.getName());
dataNodeDTO.setDescription(dataNode.getDescription());
dataNodeDTO.setVirtual(dataNode.getVirtual());
dataNodeDTO.setPublished(dataNode.getPublished());
dataNodeDTO.setAtlasVerion(dataNode.getAtlasVersion());
CommonHealthStatus healthStatus = dataNode.getHealthStatus();
dataNodeDTO.setHealthStatus(healthStatus);
dataNodeDTO.setHealthStatusTitle(healthStatus.toString());
final Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
final Long loggedUserId = ((ArachneUser) principal).getId();
final User loggedUser = new User();
loggedUser.setId(loggedUserId);
dataNodeDTO.setCurrentUserDataOwner(DataNodeUtils.isDataNodeOwner(dataNode, loggedUser));
return dataNodeDTO;
}
Aggregations