return "console/directory/userCreate";
}
@RequestMapping("/console/directory/user/view/(*:id)")
public String consoleUserView(ModelMap model, @RequestParam("id") String id) {
User user = directoryManager.getUserById(id);
model.addAttribute("user", user);
if (user != null) {
//get only 1st employment
if (user.getEmployments() != null && user.getEmployments().size() > 0) {
Employment employment = (Employment) user.getEmployments().iterator().next();
model.addAttribute("employment", directoryManager.getEmployment(employment.getId()));
}
//get roles
String roles = "";
if (user.getRoles() != null && user.getRoles().size() > 0) {
for (Role role : (Set<Role>) user.getRoles()) {
roles += role.getName() + ", ";
}
//remove trailing comma
roles = roles.substring(0, roles.length() - 2);