use of fi.otavanopisto.muikku.plugins.announcer.dao.AnnouncementTimeFrame in project muikku by otavanopisto.
the class AnnouncementsViewBackingBean method init.
@RequestAction
public String init() {
UserEntity loggedUserEntity = sessionController.getLoggedUserEntity();
if (announcementId != null) {
currentAnnouncement = announcementController.findById(announcementId);
if (currentAnnouncement != null) {
List<AnnouncementWorkspace> announcementWorkspaces = announcementController.listAnnouncementWorkspacesSortByUserFirst(currentAnnouncement, loggedUserEntity);
currentAnnouncementWorkspaces = new ArrayList<WorkspaceBasicInfo>();
for (AnnouncementWorkspace aw : announcementWorkspaces) {
currentAnnouncementWorkspaces.add(workspaceRESTModelController.workspaceBasicInfo(aw.getWorkspaceEntityId()));
}
}
}
AnnouncementEnvironmentRestriction environment = sessionController.hasEnvironmentPermission(AnnouncerPermissions.LIST_ENVIRONMENT_GROUP_ANNOUNCEMENTS) ? AnnouncementEnvironmentRestriction.PUBLICANDGROUP : AnnouncementEnvironmentRestriction.PUBLIC;
AnnouncementTimeFrame timeFrame = AnnouncementTimeFrame.CURRENT;
activeAnnouncements = announcementController.listAnnouncements(true, true, environment, timeFrame, loggedUserEntity, false, false);
return null;
}
Aggregations