Search in sources :

Example 81 with CourseGroupManager

use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.

the class PreviewConfigHelper method getPreviewCourseEnvironment.

public static CourseEnvironment getPreviewCourseEnvironment(boolean isCoach, boolean isCourseAdmin, ICourse course) {
    // generateEnvironment();
    final RepositoryEntry courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    final CourseGroupManager cgm = new PreviewCourseGroupManager(courseResource, new ArrayList<BusinessGroup>(), new ArrayList<BGArea>(), isCoach, isCourseAdmin);
    final UserNodeAuditManager auditman = new PreviewAuditManager();
    final AssessmentManager am = new PreviewAssessmentManager();
    final CoursePropertyManager cpm = new PreviewCoursePropertyManager();
    final Structure runStructure = course.getEditorTreeModel().createStructureForPreview();
    final String title = course.getCourseTitle();
    final CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
    CourseEnvironment previewCourseEnvironment = new PreviewCourseEnvironment(title, runStructure, new Date(), course.getCourseFolderContainer(), course.getCourseBaseContainer(), course.getResourceableId(), cpm, cgm, auditman, am, courseConfig);
    return previewCourseEnvironment;
}
Also used : CourseGroupManager(org.olat.course.groupsandrights.CourseGroupManager) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) BusinessGroup(org.olat.group.BusinessGroup) AssessmentManager(org.olat.course.assessment.AssessmentManager) RepositoryEntry(org.olat.repository.RepositoryEntry) Date(java.util.Date) CourseConfig(org.olat.course.config.CourseConfig) UserNodeAuditManager(org.olat.course.auditing.UserNodeAuditManager) BGArea(org.olat.group.area.BGArea) Structure(org.olat.course.Structure) CoursePropertyManager(org.olat.course.properties.CoursePropertyManager)

Example 82 with CourseGroupManager

use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.

the class UserCourseEnvironmentImpl method isAdminOfAnyCourse.

@Override
public boolean isAdminOfAnyCourse() {
    if (adminAnyCourse != null) {
        return adminAnyCourse.booleanValue();
    }
    CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
    boolean adminLazy = identityEnvironment.getRoles().isOLATAdmin() || identityEnvironment.getRoles().isInstitutionalResourceManager() || cgm.isIdentityAnyCourseAdministrator(identityEnvironment.getIdentity());
    adminAnyCourse = new Boolean(adminLazy);
    return adminLazy;
}
Also used : CourseGroupManager(org.olat.course.groupsandrights.CourseGroupManager)

Example 83 with CourseGroupManager

use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.

the class UserCourseEnvironmentImpl method isCoachOfAnyCourse.

@Override
public boolean isCoachOfAnyCourse() {
    if (coachAnyCourse != null) {
        return coachAnyCourse.booleanValue();
    }
    CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
    boolean coachLazy = cgm.isIdentityAnyCourseCoach(identityEnvironment.getIdentity());
    coachAnyCourse = new Boolean(coachLazy);
    return coachLazy;
}
Also used : CourseGroupManager(org.olat.course.groupsandrights.CourseGroupManager)

Example 84 with CourseGroupManager

use of org.olat.course.groupsandrights.CourseGroupManager in project openolat by klemens.

the class UserCourseEnvironmentImpl method isParticipantOfAnyCourse.

@Override
public boolean isParticipantOfAnyCourse() {
    if (participantAnyCourse != null) {
        return participantAnyCourse.booleanValue();
    }
    CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
    boolean participantLazy = cgm.isIdentityAnyCourseParticipant(identityEnvironment.getIdentity());
    participantAnyCourse = new Boolean(participantLazy);
    return participantLazy;
}
Also used : CourseGroupManager(org.olat.course.groupsandrights.CourseGroupManager)

Aggregations

CourseGroupManager (org.olat.course.groupsandrights.CourseGroupManager)84 Identity (org.olat.core.id.Identity)28 ICourse (org.olat.course.ICourse)28 BusinessGroup (org.olat.group.BusinessGroup)26 RepositoryEntry (org.olat.repository.RepositoryEntry)22 HashSet (java.util.HashSet)12 Roles (org.olat.core.id.Roles)12 ArrayList (java.util.ArrayList)10 BusinessGroupService (org.olat.group.BusinessGroupService)10 KalendarRenderWrapper (org.olat.commons.calendar.ui.components.KalendarRenderWrapper)8 UserRequest (org.olat.core.gui.UserRequest)8 CourseEditorEnv (org.olat.course.editor.CourseEditorEnv)8 PersistingCourseGroupManager (org.olat.course.groupsandrights.PersistingCourseGroupManager)8 OLATResource (org.olat.resource.OLATResource)8 File (java.io.File)6 Date (java.util.Date)6 CalendarManager (org.olat.commons.calendar.CalendarManager)6 Publisher (org.olat.core.commons.services.notifications.Publisher)6 OLATResourceable (org.olat.core.id.OLATResourceable)6 AssertException (org.olat.core.logging.AssertException)6