Search in sources :

Example 1 with PortletEntry

use of org.olat.core.gui.control.generic.portal.PortletEntry in project OpenOLAT by OpenOLAT.

the class NotificationsPortletRunController method reloadModel.

/**
 * @see org.olat.core.gui.control.generic.portal.AbstractPortletRunController#reloadModel(org.olat.core.gui.UserRequest, org.olat.core.gui.control.generic.portal.SortingCriteria)
 */
protected void reloadModel(SortingCriteria sortingCriteria) {
    if (sortingCriteria.getSortingType() == SortingCriteria.AUTO_SORTING) {
        Map<Subscriber, SubscriptionInfo> subscriptionMap = NotificationHelper.getSubscriptionMap(getIdentity(), getLocale(), true, compareDate);
        notificationsList = new ArrayList<Subscriber>();
        for (Iterator<Map.Entry<Subscriber, SubscriptionInfo>> it_subs = subscriptionMap.entrySet().iterator(); it_subs.hasNext(); ) {
            Map.Entry<Subscriber, SubscriptionInfo> sInfo = it_subs.next();
            Subscriber subscrer = sInfo.getKey();
            SubscriptionInfo infos = sInfo.getValue();
            if (infos.hasNews()) {
                notificationsList.add(subscrer);
            }
        }
        notificationsList = getSortedList(notificationsList, sortingCriteria);
        List<PortletEntry<Subscriber>> entries = convertNotificationToPortletEntryList(notificationsList);
        notificationListModel = new NotificationsPortletTableDataModel(entries, getLocale(), subscriptionMap);
        tableCtr.setTableDataModel(notificationListModel);
    } else {
        reloadModel(getPersistentManuallySortedItems());
    }
}
Also used : PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) Subscriber(org.olat.core.commons.services.notifications.Subscriber) SubscriptionInfo(org.olat.core.commons.services.notifications.SubscriptionInfo) Map(java.util.Map)

Example 2 with PortletEntry

use of org.olat.core.gui.control.generic.portal.PortletEntry in project OpenOLAT by OpenOLAT.

the class GroupsPortletRunController method convertShortBusinessGroupToPortletEntryList.

private List<PortletEntry<BusinessGroupEntry>> convertShortBusinessGroupToPortletEntryList(List<BusinessGroup> groups, boolean withDescription) {
    List<PortletEntry<BusinessGroupEntry>> convertedList = new ArrayList<PortletEntry<BusinessGroupEntry>>();
    for (BusinessGroup group : groups) {
        GroupPortletEntry entry = new GroupPortletEntry(group);
        if (withDescription) {
            entry.getValue().setDescription(group.getDescription());
        }
        convertedList.add(entry);
    }
    return convertedList;
}
Also used : PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) BusinessGroup(org.olat.group.BusinessGroup) ArrayList(java.util.ArrayList)

Example 3 with PortletEntry

use of org.olat.core.gui.control.generic.portal.PortletEntry in project OpenOLAT by OpenOLAT.

the class RepositoryPortletRunController method convertShortRepositoryEntriesToPortletEntryList.

private List<PortletEntry<RepositoryEntryLight>> convertShortRepositoryEntriesToPortletEntryList(List<RepositoryEntryLight> items) {
    List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
    for (RepositoryEntryLight item : items) {
        boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
        if (!closed) {
            RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
            convertedList.add(entry);
        }
    }
    return convertedList;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) ArrayList(java.util.ArrayList)

Example 4 with PortletEntry

use of org.olat.core.gui.control.generic.portal.PortletEntry in project OpenOLAT by OpenOLAT.

the class RepositoryPortletRunController method convertRepositoryEntriesToPortletEntryList.

private List<PortletEntry<RepositoryEntryLight>> convertRepositoryEntriesToPortletEntryList(List<RepositoryEntry> items) {
    List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
    for (RepositoryEntry item : items) {
        boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
        if (!closed) {
            RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
            convertedList.add(entry);
        }
    }
    return convertedList;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 5 with PortletEntry

use of org.olat.core.gui.control.generic.portal.PortletEntry in project openolat by klemens.

the class RepositoryPortletRunController method convertRepositoryEntriesToPortletEntryList.

private List<PortletEntry<RepositoryEntryLight>> convertRepositoryEntriesToPortletEntryList(List<RepositoryEntry> items) {
    List<PortletEntry<RepositoryEntryLight>> convertedList = new ArrayList<PortletEntry<RepositoryEntryLight>>();
    for (RepositoryEntry item : items) {
        boolean closed = RepositoryManager.getInstance().createRepositoryEntryStatus(item.getStatusCode()).isClosed();
        if (!closed) {
            RepositoryPortletEntry entry = new RepositoryPortletEntry(item);
            convertedList.add(entry);
        }
    }
    return convertedList;
}
Also used : RepositoryEntryLight(org.olat.repository.RepositoryEntryLight) PortletEntry(org.olat.core.gui.control.generic.portal.PortletEntry) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

PortletEntry (org.olat.core.gui.control.generic.portal.PortletEntry)16 ArrayList (java.util.ArrayList)12 BusinessGroup (org.olat.group.BusinessGroup)8 Map (java.util.Map)4 SubscriptionInfo (org.olat.core.commons.services.notifications.SubscriptionInfo)4 RepositoryEntryLight (org.olat.repository.RepositoryEntryLight)4 HashSet (java.util.HashSet)2 Subscriber (org.olat.core.commons.services.notifications.Subscriber)2 SubscriptionListItem (org.olat.core.commons.services.notifications.model.SubscriptionListItem)2 BusinessGroupOrder (org.olat.group.BusinessGroupOrder)2 SearchBusinessGroupParams (org.olat.group.model.SearchBusinessGroupParams)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2