Search in sources :

Example 1 with AnnouncementTimeFrame

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;
}
Also used : AnnouncementWorkspace(fi.otavanopisto.muikku.plugins.announcer.workspace.model.AnnouncementWorkspace) AnnouncementTimeFrame(fi.otavanopisto.muikku.plugins.announcer.dao.AnnouncementTimeFrame) AnnouncementEnvironmentRestriction(fi.otavanopisto.muikku.plugins.announcer.dao.AnnouncementEnvironmentRestriction) WorkspaceBasicInfo(fi.otavanopisto.muikku.plugins.workspace.rest.model.WorkspaceBasicInfo) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) RequestAction(org.ocpsoft.rewrite.annotation.RequestAction)

Aggregations

UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)1 AnnouncementEnvironmentRestriction (fi.otavanopisto.muikku.plugins.announcer.dao.AnnouncementEnvironmentRestriction)1 AnnouncementTimeFrame (fi.otavanopisto.muikku.plugins.announcer.dao.AnnouncementTimeFrame)1 AnnouncementWorkspace (fi.otavanopisto.muikku.plugins.announcer.workspace.model.AnnouncementWorkspace)1 WorkspaceBasicInfo (fi.otavanopisto.muikku.plugins.workspace.rest.model.WorkspaceBasicInfo)1 RequestAction (org.ocpsoft.rewrite.annotation.RequestAction)1