use of org.olat.group.model.SearchBusinessGroupParams in project openolat by klemens.
the class GroupsPortletRunController method getPersistentManuallySortedItems.
/**
* Retrieves the persistent manually sorted items for the current portlet.
* @param ureq
* @return
*/
private List<PortletEntry<BusinessGroupEntry>> getPersistentManuallySortedItems() {
@SuppressWarnings("unchecked") Map<Long, Integer> storedPrefs = (Map<Long, Integer>) guiPreferences.get(Map.class, getPreferenceKey(SORTED_ITEMS_PREF));
List<PortletEntry<BusinessGroupEntry>> portletEntryList;
if (storedPrefs != null) {
SearchBusinessGroupParams params = new SearchBusinessGroupParams(getIdentity(), true, true);
params.setGroupKeys(storedPrefs.keySet());
List<BusinessGroup> groups = businessGroupService.findBusinessGroups(params, null, 0, -1);
portletEntryList = convertBusinessGroupToPortletEntryList(groups, false);
} else {
List<BusinessGroup> groups = new ArrayList<BusinessGroup>();
portletEntryList = convertShortBusinessGroupToPortletEntryList(groups, false);
}
return getPersistentManuallySortedItems(portletEntryList);
}
use of org.olat.group.model.SearchBusinessGroupParams in project openolat by klemens.
the class HomeCalendarManager method appendGroupCalendars.
private void appendGroupCalendars(Identity identity, List<KalendarRenderWrapper> calendars, Map<CalendarKey, CalendarUserConfiguration> configMap) {
// get group calendars
if (calendarModule.isEnableGroupCalendar()) {
SearchBusinessGroupParams groupParams = new SearchBusinessGroupParams(identity, true, false);
groupParams.addTools(CollaborationTools.TOOL_CALENDAR);
List<BusinessGroup> ownerGroups = businessGroupService.findBusinessGroups(groupParams, null, 0, -1);
addCalendars(ownerGroups, true, false, calendars, configMap);
SearchBusinessGroupParams groupParams2 = new SearchBusinessGroupParams(identity, false, true);
groupParams2.addTools(CollaborationTools.TOOL_CALENDAR);
List<BusinessGroup> attendedGroups = businessGroupService.findBusinessGroups(groupParams2, null, 0, -1);
attendedGroups.removeAll(ownerGroups);
addCalendars(attendedGroups, false, true, calendars, configMap);
}
}
Aggregations