context.addError(Errors.NOT_REGISTERED);
return createResult(context, null);
}
// Build the Home DTO
final HomeDTO home = new HomeDTO();
home.setNickname(user.getNickname());
home.setUserId(user.getKey().getId());
/*
* General notifications.
*/
home.setNotifications(DTOUtil.mapNotification(
homeService.getNotifications(context, null), NotificationType.GLOBAL));
/*
* User notifications.
*/
home.setUserNotifications(DTOUtil.mapNotification(
homeService.getNotifications(context, user.getKey()), NotificationType.USER));
/*
* Characters
*/
final List<CharacterSummary> characters = homeService.getCharacterSummaries(context);
home.setCharacters(DTOUtil.mapCharacterSummary(characters));
/*
* Campaigns
*/
final List<CampaignSummary> campaigns = homeService.getCampaignSummaries(context);
home.setCampaigns(DTOUtil.mapCampaignSummary(campaigns));
return createResult(context, home);
}