private void initBasicRoles() { List<String> sourceRole = new ArrayList<String>(); targetRole = new ArrayList<String>(); List<Role> availableRoles = registrationDao.findAllRoles(); for (Role role : availableRoles) { if (!role.getRoleName().toLowerCase().equals("administrator")) { sourceRole.add(role.getRoleName()); } } Collections.sort(sourceRole); roleDefinitions = new DualListModel<String>(sourceRole, targetRole); }
private void prepareUpdatedRolePickup() { targetRole = new ArrayList<String>(); sourceRole = new ArrayList<String>(); for (Role role : registrationDao.findRolesByUser(userToUpdate)) { targetRole.add(role.getRoleName()); } for (Role role : registrationDao.findNotAssignedRolesByUser(userToUpdate)) { if (!role.getRoleName().toLowerCase().equals("administrator")) { sourceRole.add(role.getRoleName()); } } roleDefinitions = new DualListModel<String>(sourceRole, targetRole); }