for (Integer siteId : sites) {
Set groups = groupManagerService.searchGroups(siteId, criterias);
if (groups != null) {
Iterator iterator = groups.iterator();
JahiaGroup group;
GWTJahiaGroup data;
while (iterator.hasNext()) {
group = (JahiaGroup) iterator.next();
if (!group.isHidden()) {
data = new GWTJahiaGroup(group.getGroupname(), group.getGroupKey());
if (group.getSiteID() > 0) {
JahiaSite jahiaSite = sitesService.getSite(group.getSiteID());
if (jahiaSite != null) {
data.setSiteName(jahiaSite.getTitle());
}
}
data.setSiteId(siteId);
data.setProvider(group.getProviderName());
result.add(data);
}
}
}
}