use of eu.bcvsolutions.idm.core.api.dto.BaseDto in project CzechIdMng by bcvsolutions.
the class DefaultIdmIdentityRoleService method toDto.
@Override
protected IdmIdentityRoleDto toDto(IdmIdentityRole entity, IdmIdentityRoleDto dto) {
dto = super.toDto(entity, dto);
if (dto == null) {
return null;
}
//
IdmAutomaticRole automaticRole = entity.getAutomaticRole();
if (automaticRole != null) {
dto.setRoleTreeNode(automaticRole.getId());
dto.setAutomaticRole(true);
BaseDto baseDto = null;
Map<String, BaseDto> embedded = dto.getEmbedded();
if (automaticRole instanceof IdmAutomaticRoleAttribute) {
baseDto = lookupService.getDtoService(IdmAutomaticRoleAttributeDto.class).get(automaticRole.getId());
} else {
baseDto = lookupService.getDtoService(IdmRoleTreeNodeDto.class).get(automaticRole.getId());
}
embedded.put(IdmAutomaticRoleAttributeService.ROLE_TREE_NODE_ATTRIBUTE_NAME, baseDto);
dto.setEmbedded(embedded);
}
//
return dto;
}
Aggregations