Package org.olat.course.groupsandrights

Examples of org.olat.course.groupsandrights.CourseGroupManager


    cl.addAllIdentites(coaches);
    return cl;
  }

  private ContactList retrieveParticipants() {
    CourseGroupManager cgm = this.userCourseEnv.getCourseEnvironment().getCourseGroupManager();
    List<Identity> participiants = cgm.getParticipantsFromLearningGroup(null);
    //FIXME:pb:c docu getParticipantsFromLearningGroup: really duplicates?
    Set<Identity> participantsWithoutDuplicates = new HashSet<Identity>(participiants);
   
    participiants = new ArrayList<Identity>(participantsWithoutDuplicates);
    ContactList cl = new ContactList(translate("form.message.chckbx.partips"));
View Full Code Here


    return cl;

  }

  private ContactList[] retrieveGroups(String csvGroups) {
    CourseGroupManager cgm = this.userCourseEnv.getCourseEnvironment().getCourseGroupManager();
    Manager secManager = ManagerFactory.getManager();
    List<String> groupNames = splitNames(csvGroups);
    List<ContactList> groupsCL = new ArrayList<ContactList>();
    /*
     * for each group name in all the course's group contexts get the
     * participants groups. From the resulting groups take all participants and
     * add the identities to the ContactList named like the group.
     */
    Iterator<String> iterator = groupNames.iterator();
    while (iterator.hasNext()) {
      // fetch all participants and owners by getting all participants and
      // owners of all groups
      String groupName = iterator.next();
      List<BusinessGroup> mygroups = cgm.getLearningGroupsFromAllContexts(groupName);
      // create a ContactList with the name of the group
      ContactList tmp = new ContactList(groupName);
      for (int i = 0; i < mygroups.size(); i++) {
        BusinessGroup bg = mygroups.get(i);
        List<Identity> ids = secManager.getIdentitiesOfSecurityGroup(bg.getPartipiciantGroup());
View Full Code Here

    retVal = groupsCLWithouthDups.toArray(retVal);
    return retVal;
  }

  private ContactList[] retrieveAreas(String csvAreas) {
    CourseGroupManager cgm = this.userCourseEnv.getCourseEnvironment().getCourseGroupManager();
    Manager secManager = ManagerFactory.getManager();
    List<String> areaNames = splitNames(csvAreas);
    List<ContactList> groupsCL = new ArrayList<ContactList>();
    /*
     * for each area name in all the course's group contexts get the
     * participants groups. From the resulting groups take all participants and
     * add the identities to the ContactList named like the group.
     */
    Iterator<String> iterator = areaNames.iterator();
    while (iterator.hasNext()) {
      // fetch all participants and owners by getting all participants and
      // owners of all groups
      String areaName = iterator.next();
      List<BusinessGroup> mygroups = cgm.getLearningGroupsInAreaFromAllContexts(areaName);
      // create a ContactList with the name of the group
      ContactList tmp = new ContactList(areaName);
      for (int i = 0; i < mygroups.size(); i++) {
        BusinessGroup bg = mygroups.get(i);
        List<Identity> ids = secManager.getIdentitiesOfSecurityGroup(bg.getPartipiciantGroup());
View Full Code Here

    runVC = new VelocityContainer("dateVC", VELOCITY_ROOT + "/run.html", getTranslator(), this);
   
    //show only the options for managing dates and participants if user is admin or course coach
    ICourse course = CourseFactory.loadCourse(ores);
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    if(cgm.isIdentityCourseAdministrator(ureq.getIdentity()) || cgm.isIdentityCourseCoach(ureq.getIdentity())) {
      // subscription
      subsContext = new SubscriptionContext(course, courseNode.getIdent());
      // if sc is null, then no subscription is desired
      if (subsContext != null) {
        String businessPath = wControl.getBusinessControl().getAsString();
View Full Code Here

    /*previewButton = LinkFactory.createButtonSmall("command.preview", content, this);*/
    chooseButton = LinkFactory.createButtonSmall("command.create", content, this);
    changeButton = LinkFactory.createButtonSmall("command.change", content, this);
       
    editAccessVc = this.createVelocityContainer("edit_access");
    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    // Accessibility precondition
    Condition accessCondition = wikiCourseNode.getPreConditionAccess();
    accessCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessConditionForm",
        AssessmentHelper.getAssessableNodes(editorModel, wikiCourseNode), euce);   
View Full Code Here

    initConfigForm();

    // accessability config tab   
    accessContent = this.createVelocityContainer("edit_access");

    CourseGroupManager groupMgr = course.getCourseEnvironment().getCourseGroupManager();
    CourseEditorTreeModel editorModel = course.getEditorTreeModel();
    // Reader precondition
    Condition readerCondition = courseNode.getPreConditionReader();
    // TODO:gs:a getAssessableNodes ist der dialog node assessable oder nicht?
    readerCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, readerCondition, "readerConditionForm",
View Full Code Here

  /*
   * find default context if one is present
   */
  private BGContext getDefaultBGContext() {
    CourseGroupManager courseGrpMngr = cev.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

  public boolean transactionFinishBeforeCreate() {
    // Create course and persist course resourceable.
    course = CourseFactory.createEmptyCourse(
        newCourseResource, "New Course", "New Course", "");
    // initialize course groupmanagement
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    cgm.createCourseGroupmanagement(course.getResourceableId().toString());

    return true;
  }
View Full Code Here

  /**
   * @see org.olat.repository.controllers.IAddController#transactionFinishBeforeCreate()
   */
  public boolean transactionFinishBeforeCreate() {
    // create group management
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    cgm.createCourseGroupmanagement(course.getResourceableId().toString());
    // import groups
    cgm.importCourseLearningGroups(getExportDataDir(course));
    cgm.importCourseRightGroups(getExportDataDir(course));
    return true;
  }
View Full Code Here

    List calendars = new ArrayList();
    CalendarManager calendarManager = CalendarManagerFactory.getInstance().getCalendarManager();
    // add course calendar
    ICourse course = CourseFactory.loadCourse(ores);
    courseKalendarWrapper = calendarManager.getCourseCalendar(course);
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    Identity identity = ureq.getIdentity();
    boolean isPrivileged = cgm.isIdentityCourseAdministrator(identity) || cgm.hasRight(identity, CourseRights.RIGHT_COURSEEDITOR) || RepositoryManager.getInstance().isInstitutionalRessourceManagerFor(RepositoryManager.getInstance().lookupRepositoryEntry(course, false), identity);
    if (isPrivileged) {
      courseKalendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_WRITE);
    } else {
      courseKalendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
    }
    KalendarConfig config = calendarManager.findKalendarConfigForIdentity(courseKalendarWrapper.getKalendar(), ureq);
    if (config != null) {
      courseKalendarWrapper.getKalendarConfig().setCss(config.getCss());
      courseKalendarWrapper.getKalendarConfig().setVis(config.isVis());
    }
    // add link provider
    CourseLinkProviderController clpc = new CourseLinkProviderController(course, ureq, getWindowControl());
    courseKalendarWrapper.setLinkProvider(clpc);
    calendars.add(courseKalendarWrapper);
   
    // add course group calendars
    boolean isGroupManager = cgm.isIdentityCourseAdministrator(identity) || cgm.hasRight(identity, CourseRights.RIGHT_GROUPMANAGEMENT);
    if (isGroupManager) {
      // learning groups
      List allGroups = cgm.getAllLearningGroupsFromAllContexts();
      addCalendars(ureq, allGroups, true, clpc, calendars);
      // right groups
      allGroups = cgm.getAllRightGroupsFromAllContexts();
      addCalendars(ureq, allGroups, true, clpc, calendars);
    } else {
      // learning groups
      List ownerGroups = cgm.getOwnedLearningGroupsFromAllContexts(identity);
      addCalendars(ureq, ownerGroups, true, clpc, calendars);
      List attendedGroups = cgm.getParticipatingLearningGroupsFromAllContexts(identity);
      for (Iterator ownerGroupsIterator = ownerGroups.iterator(); ownerGroupsIterator.hasNext();) {
        BusinessGroup ownerGroup = (BusinessGroup) ownerGroupsIterator.next();
        if (attendedGroups.contains(ownerGroup))
          attendedGroups.remove(ownerGroup);
      }
      addCalendars(ureq, attendedGroups, false, clpc, calendars);

      // right groups
      List rightGroups = cgm.getParticipatingRightGroupsFromAllContexts(identity);
      addCalendars(ureq, rightGroups, false, clpc, calendars);
    }
    return calendars;
  }
View Full Code Here

TOP

Related Classes of org.olat.course.groupsandrights.CourseGroupManager

Copyright © 2018 www.massapicom. 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.