use of org.olat.course.groupsandrights.CourseGroupManager in project OpenOLAT by OpenOLAT.
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;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project OpenOLAT by OpenOLAT.
the class RunMainController method reloadGroupMemberships.
/**
* Initialize the users group memberships for groups used within this course
*
* @param identity
*/
protected void reloadGroupMemberships(RepositoryEntrySecurity reSecurity) {
CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
List<BusinessGroup> coachedGroups;
if (reSecurity.isGroupCoach()) {
coachedGroups = cgm.getOwnedBusinessGroups(getIdentity());
} else {
coachedGroups = Collections.emptyList();
}
List<BusinessGroup> participatedGroups;
if (reSecurity.isGroupParticipant()) {
participatedGroups = cgm.getParticipatingBusinessGroups(getIdentity());
} else {
participatedGroups = Collections.emptyList();
}
List<BusinessGroup> waitingLists;
if (reSecurity.isGroupWaiting()) {
waitingLists = cgm.getWaitingListGroups(getIdentity());
} else {
waitingLists = Collections.emptyList();
}
uce.setCourseReadOnly(reSecurity.isReadOnly());
uce.setGroupMemberships(coachedGroups, participatedGroups, waitingLists);
needsRebuildAfterRunDone = true;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project OpenOLAT by OpenOLAT.
the class UserCourseEnvironmentImpl method isAdmin.
@Override
public boolean isAdmin() {
if (admin != null) {
return admin.booleanValue();
}
// lazy loading
CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
boolean admiLazy = cgm.isIdentityCourseAdministrator(identityEnvironment.getIdentity());
admin = new Boolean(admiLazy);
return admiLazy;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project OpenOLAT by OpenOLAT.
the class UserCourseEnvironmentImpl method isParticipant.
@Override
public boolean isParticipant() {
if (participant != null) {
return participant.booleanValue();
}
// lazy loading
CourseGroupManager cgm = courseEnvironment.getCourseGroupManager();
boolean partLazy = cgm.isIdentityCourseParticipant(identityEnvironment.getIdentity());
participant = new Boolean(partLazy);
return partLazy;
}
use of org.olat.course.groupsandrights.CourseGroupManager in project OpenOLAT by OpenOLAT.
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;
}
Aggregations