Examples of CourseGroupManager


Examples of org.olat.course.groupsandrights.CourseGroupManager

  /*
   * find default context if one is present
   */
  private BGContext getDefaultBGContext() {
    CourseGroupManager courseGrpMngr = courseEditorEnv.getCourseGroupManager();
    List courseLGContextes = courseGrpMngr.getLearningGroupContexts();
    for (Iterator iter = courseLGContextes.iterator(); iter.hasNext();) {
      BGContext bctxt = (BGContext) iter.next();
      if (bctxt.isDefaultContext()) { return bctxt; }
    }
    return null;
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

    currentNodeController.addControllerListener(this);
    content.setContent(currentNodeController.getInitialComponent());
    detail.put("content", content);
    detail.contextPut("time", DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, ureq.getLocale())
        .format(new Date(uce.getCourseEnvironment().getCurrentTimeMillis())));
    CourseGroupManager cgm = uce.getCourseEnvironment().getCourseGroupManager();
    detail.contextPut("groups", assembleNamesFromList(cgm.getAllLearningGroupsFromAllContexts()));
    detail.contextPut("areas", assembleNamesFromList(cgm.getAllAreasFromAllContexts()));
    detail.contextPut("asRole",role);
    previewLayoutCtr.setCol3(detail);
   
  }
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

      isCourseAdmin = true;
    } else if (role.equals(PreviewSettingsForm.ROLE_GLOBALAUTHOR)) {
      isGlobalAuthor = true;
    }

    final CourseGroupManager cgm = new PreviewCourseGroupManager(groups, new ArrayList(areas), 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();
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

*/
public class PreviewConfigHelper {

  public static CourseEnvironment getPreviewCourseEnvironment(boolean isCoach, boolean isCourseAdmin, ICourse course) {
    //generateEnvironment();       
    final CourseGroupManager cgm = new PreviewCourseGroupManager(new ArrayList(), new ArrayList(), 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();
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

  @Override
  public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
      UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    ICourse course = CourseFactory.loadCourse(userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    boolean canEdit = ureq.getUserSession().getRoles().isOLATAdmin() || cgm.isIdentityCourseAdministrator(ureq.getIdentity());
    boolean canManage;
    if(canEdit) canManage = true;
    else canManage = cgm.isIdentityCourseCoach(ureq.getIdentity()) | cgm.hasRight(ureq.getIdentity(), CourseRights.RIGHT_GROUPMANAGEMENT);
    Controller controller = ChecklistUIFactory.getInstance().createDisplayController(ureq, wControl, loadOrCreateChecklist(userCourseEnv.getCourseEnvironment().getCoursePropertyManager()), null, canEdit, canManage, course);
    // Add title and descrition
    controller = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_cl_icon");
    return new NodeRunConstructionResult(controller);
  }
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

    Identity ident = getUserCourseEnv().getIdentityEnvironment().getIdentity();
    CourseGroupManager cgm = getUserCourseEnv().getCourseEnvironment().getCourseGroupManager();
    boolean isCourseCoach = cgm.isIdentityCourseCoach(ident);
    if (Tracing.isDebugEnabled(IsCourseCoachFunction.class)) {
      Tracing.logDebug("identity "+ident.getName()+", coursecoach:"+isCourseCoach+", in course "+getUserCourseEnv().getCourseEnvironment().getCourseResourceableId(), IsCourseCoachFunction.class);
    }
   
    return isCourseCoach ? ConditionInterpreter.INT_TRUE: ConditionInterpreter.INT_FALSE;
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

    }
    return extendedCourseTitle;
  }

  private void initUserRolesAndRights(final Identity identity) {
    CourseGroupManager cgm = this.course.getCourseEnvironment().getCourseGroupManager();
    // 1) course admins: users who are in repository entry owner group
    // if user has the role InstitutionalResourceManager and has the same institution like author
    // then set isCourseAdmin true
    isCourseAdmin = cgm.isIdentityCourseAdministrator(identity) | RepositoryManager.getInstance().isInstitutionalRessourceManagerFor(courseRepositoryEntry, identity);
    // 2) course coaches: users who are in the owner group of any group of this
    // course
    isCourseCoach = cgm.isIdentityCourseCoach(identity);
    // 3) all other rights are defined in the groupmanagement using the learning
    // group rights
    courseRightsCache.put(CourseRights.RIGHT_GROUPMANAGEMENT, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_GROUPMANAGEMENT)));
    courseRightsCache.put(CourseRights.RIGHT_COURSEEDITOR, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_COURSEEDITOR)));
    courseRightsCache.put(CourseRights.RIGHT_ARCHIVING, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_ARCHIVING)));
    courseRightsCache.put(CourseRights.RIGHT_ASSESSMENT, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_ASSESSMENT)));
    courseRightsCache.put(CourseRights.RIGHT_GLOSSARY, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_GLOSSARY)));
    courseRightsCache.put(CourseRights.RIGHT_STATISTICS, new Boolean(cgm.hasRight(identity, CourseRights.RIGHT_STATISTICS)));
  }
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

   * Initialize the users group memberships for groups used within this course
   *
   * @param identity
   */
  private void initGroupMemberships(Identity identity) {
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    ownedGroups = cgm.getOwnedLearningGroupsFromAllContexts(identity);
    participatedGroups = cgm.getParticipatingLearningGroupsFromAllContexts(identity);
    waitingListGroups = cgm.getWaitingListGroupsFromAllContexts(identity);
    rightGroups = cgm.getParticipatingRightGroupsFromAllContexts(identity);
  }
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

   * @param courseEnv
   * @return The list of identities from this course
   */
  public static List loadUsers(CourseEnvironment courseEnv) {
    List identites = new ArrayList();
    CourseGroupManager gm = courseEnv.getCourseGroupManager();
    Manager securityManager = ManagerFactory.getManager();
    List groups = gm.getAllLearningGroupsFromAllContexts();

    Iterator iter = groups.iterator();
    while (iter.hasNext()) {
      BusinessGroup group = (BusinessGroup) iter.next();
      SecurityGroup participants = group.getPartipiciantGroup();
View Full Code Here

Examples of org.olat.course.groupsandrights.CourseGroupManager

    this.groupType = groupType;
    // set user activity logger for this controller
    ICourse course = CourseFactory.loadCourse(ores);
    addLoggingResourceable(LoggingResourceable.wrap(course));

    CourseGroupManager groupManager = course.getCourseEnvironment().getCourseGroupManager();

    List groupContexts;
    String defaultContextName;
   
    // init content panel. current panel content will be set later in init process, use null for now
    content = putInitialPanel(null);

    if (BusinessGroup.TYPE_LEARNINGROUP.equals(groupType)) {
      groupContexts = groupManager.getLearningGroupContexts();
      defaultContextName = CourseGroupManager.DEFAULT_NAME_LC_PREFIX + course.getCourseTitle();
    } else if (BusinessGroup.TYPE_RIGHTGROUP.equals(groupType)) {
      groupContexts = groupManager.getRightGroupContexts();
      defaultContextName = CourseGroupManager.DEFAULT_NAME_RC_PREFIX + course.getCourseTitle();
    } else {
      throw new AssertException("Invalid group type ::" + groupType);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.