use of fi.otavanopisto.muikku.plugins.announcer.model.Announcement in project muikku by otavanopisto.
the class AnnouncementController method listActiveByWorkspaceEntities.
public List<Announcement> listActiveByWorkspaceEntities(List<WorkspaceEntity> workspaceEntities) {
List<Long> workspaceEntityIds = new ArrayList<>(workspaceEntities.size());
for (WorkspaceEntity workspaceEntity : workspaceEntities) {
workspaceEntityIds.add(workspaceEntity.getId());
}
List<Announcement> result = new ArrayList<>(announcementDAO.listAnnouncements(Collections.emptyList(), workspaceEntities, AnnouncementEnvironmentRestriction.NONE, AnnouncementTimeFrame.CURRENT, false));
Collections.sort(result, new Comparator<Announcement>() {
public int compare(Announcement o1, Announcement o2) {
return o2.getStartDate().compareTo(o1.getStartDate());
}
});
return result;
}
Aggregations