{
groups = new LinkedList();
Iterator fullGroups = groupManager.getGroups("");
while (fullGroups.hasNext())
{
Group group = (Group)fullGroups.next();
groups.add(group.getPrincipal().getName());
}
request.getPortletSession().setAttribute(GROUPS_CONTROL, groups);
}
}
catch (SecurityException se)
{
throw new PortletException(se);
}
ArrayList selectableGroups = new ArrayList(groups);
Iterator groupsIter = userGroups.iterator();
while ( groupsIter.hasNext() )
{
Group group = (Group)groupsIter.next();
int index = selectableGroups.indexOf(group.getPrincipal().getName());
if (index != -1)
{
selectableGroups.remove(index);
}
}