Link[] ownerGroupLinks= new Link[ownerGroups.size()];
int ownerNumber = 0;
for (Iterator iter = ownerGroups.iterator(); iter.hasNext();) {
BusinessGroup group = (BusinessGroup) iter.next();
Link tmp = LinkFactory.createCustomLink("cmd.user.remove.group.own." + group.getKey(), "cmd.user.remove.group.own." + group.getKey(), "userdetails.remove", Link.BUTTON_SMALL, userDetailsVC, this);
tmp.setUserObject(group);
ownerGroupLinks[ownerNumber] = tmp;
ownerNumber++;
}
userDetailsVC.contextPut("ownerGroupLinks", ownerGroupLinks);
userDetailsVC.contextPut("noOwnerGroups", (ownerGroups.size() > 0 ? Boolean.FALSE : Boolean.TRUE));
userDetailsVC.contextPut("showOwnerGroups", Boolean.TRUE);
} else {
userDetailsVC.contextPut("showOwnerGroups", Boolean.FALSE);
}
// 3. expose the participant groups of the identity
List participantGroups = groupManager.findBusinessGroupsAttendedBy(bgContext.getGroupType(), this.currentIdentity, bgContext);
Link[] participantGroupLinks= new Link[participantGroups.size()];
int participantNumber = 0;
for (Iterator iter = participantGroups.iterator(); iter.hasNext();) {
BusinessGroup group = (BusinessGroup) iter.next();
Link tmp = LinkFactory.createCustomLink("cmd.user.remove.group.part." + group.getKey(), "cmd.user.remove.group.part." + group.getKey(), "userdetails.remove", Link.BUTTON_SMALL, userDetailsVC, this);
tmp.setUserObject(group);
participantGroupLinks[participantNumber] = tmp;
participantNumber++;
}
userDetailsVC.contextPut("noParticipantGroups", (participantGroups.size() > 0 ? Boolean.FALSE : Boolean.TRUE));
userDetailsVC.contextPut("participantGroupLinks", participantGroupLinks);