Examples of BusinessGroup


Examples of org.olat.group.BusinessGroup

    String bgDesc = this.groupController.getGroupDescription();
    Integer bgMax = this.groupController.getGroupMax();
    Integer bgMin = this.groupController.getGroupMin();
    boolean copyAreas = (this.flags.isEnabled(BGConfigFlags.AREAS) && this.copyForm.isCopyAreas());

    BusinessGroup newGroup = groupManager.copyBusinessGroup(this.originalGroup, bgName, bgDesc, bgMin, bgMax, bgContext, null, copyAreas,
        copyForm.isCopyTools(), copyForm.isCopyRights(), copyForm.isCopyOwners(), copyForm.isCopyParticipants(), copyForm
            .isCopyMembersVisibility(), copyForm.isCopyWaitingList());
    return newGroup;
  }
View Full Code Here

Examples of org.olat.group.BusinessGroup

    // 3. Copy Groups
    // only group configuration will be copied, no group members are copied
    List origGroups = getGroupsOfBGContext(originalBgContext);
    Iterator iter = origGroups.iterator();
    while (iter.hasNext()) {
      BusinessGroup origGroup = (BusinessGroup) iter.next();
      groupManager.copyBusinessGroup(origGroup, origGroup.getName(), origGroup.getDescription(), origGroup.getMinParticipants(), origGroup
          .getMaxParticipants(), targetContext, areas, true, true, true, false, false, true, false);
    }
    return targetContext;
  }
View Full Code Here

Examples of org.olat.group.BusinessGroup

        }

        this.newGroups = this.groupManager.createUniqueBusinessGroupsFor(allNames, this.bgContext, bgDesc, bgMin, bgMax,  enableWaitingList, enableAutoCloseRanks);
        if(this.newGroups != null){
            for (Iterator<BusinessGroup> iter = this.newGroups.iterator(); iter.hasNext();) {
              BusinessGroup bg = iter.next();
              LoggingResourceable resourceInfo = LoggingResourceable.wrap(bg);
              ThreadLocalUserActivityLogger.log(GroupLoggingAction.GROUP_CREATED, getClass(), resourceInfo)
            }           
          // workflow successfully finished
          // so far no events on the systembus to inform about new groups in BGContext
View Full Code Here

Examples of org.olat.group.BusinessGroup

    if (GROUPS_MEMBERS.equals(wizardType)) {
      List<BusinessGroup> groups = BGContextManagerImpl.getInstance().getGroupsOfBGContext(context);
      Collections.sort(groups, new Comparator() {
        @Override
        public int compare(Object o1, Object o2) {
          BusinessGroup g1 = (BusinessGroup) o1;
          BusinessGroup g2 = (BusinessGroup) o2;
          return g1.getName().compareTo(g2.getName());
        }
      });
      for (Iterator iter = groups.iterator(); iter.hasNext();) {
        BusinessGroup group = (BusinessGroup) iter.next();
        Object[] groupChoiceRowData = new Object[2];
        groupChoiceRowData[0] = new Boolean(true);
        groupChoiceRowData[1] = new ObjectWrapper(group);
        objectArrays.add(groupChoiceRowData);
      }
View Full Code Here

Examples of org.olat.group.BusinessGroup

      BGAreaManager am = BGAreaManagerImpl.getInstance();
     
      // 1) context one: learning groups
      BGContext c1 = cm.createAndAddBGContextToResource("c1name", course1, BusinessGroup.TYPE_LEARNINGROUP, id1, true);
      // create groups without waitinglist
      BusinessGroup g1 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_LEARNINGROUP, null, "g1", null, new Integer(0), new Integer(10), false, false, c1);
      BusinessGroup g2 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_LEARNINGROUP, null, "g2", null, new Integer(0), new Integer(10), false, false, c1);
      // members
      secm.addIdentityToSecurityGroup(id1, g2.getOwnerGroup());
      secm.addIdentityToSecurityGroup(id1, g1.getPartipiciantGroup());
      secm.addIdentityToSecurityGroup(id2, g1.getPartipiciantGroup());
      secm.addIdentityToSecurityGroup(id2, g2.getPartipiciantGroup());
      secm.addIdentityToSecurityGroup(id3, g1.getOwnerGroup());
      // areas
      BGArea a1 = am.createAndPersistBGAreaIfNotExists("a1", "desca1",c1);
      BGArea a2 = am.createAndPersistBGAreaIfNotExists("a2", null, c1);
      BGArea a3 = am.createAndPersistBGAreaIfNotExists("a3", null, c1);
      am.addBGToBGArea(g1, a1);   
      am.addBGToBGArea(g2, a1);
      am.addBGToBGArea(g1, a2)
      am.addBGToBGArea(g2, a3);
     
      // 2) context two: right groups
      BGContext c2 = cm.createAndAddBGContextToResource("c2name", course1, BusinessGroup.TYPE_RIGHTGROUP, id2, true);
      // groups
      BusinessGroup g3 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_RIGHTGROUP, null, "g3", null, null, null, null/* enableWaitinglist */, null/* enableAutoCloseRanks */, c2);
      BusinessGroup g4 = bgm.createAndPersistBusinessGroup(BusinessGroup.TYPE_RIGHTGROUP, null, "g4", null, null, null, null/* enableWaitinglist */, null/* enableAutoCloseRanks */, c2);
      // members
      secm.addIdentityToSecurityGroup(id1, g3.getPartipiciantGroup());
      secm.addIdentityToSecurityGroup(id1, g4.getPartipiciantGroup());
      secm.addIdentityToSecurityGroup(id3, g4.getPartipiciantGroup());
      // rights
      rm.addBGRight(CourseRights.RIGHT_ARCHIVING, g3);
      rm.addBGRight(CourseRights.RIGHT_COURSEEDITOR, g3);
      rm.addBGRight(CourseRights.RIGHT_ARCHIVING, g4);
      rm.addBGRight(CourseRights.RIGHT_GROUPMANAGEMENT, g4);
     
      DBFactory.getInstance().closeSession(); // simulate user clicks
     
      // test groups
      CourseGroupManager gm = PersistingCourseGroupManager.getInstance(course1);
      assertTrue(gm.isIdentityInLearningGroup(id1, g1.getName()));
      assertTrue(gm.isIdentityInLearningGroup(id1, g2.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id1, g3.getName())); // not a learning group
      assertFalse(gm.isIdentityInLearningGroup(id1, g4.getName())); // not a learning group

      assertTrue(gm.isIdentityInLearningGroup(id2, g1.getName()));
      assertTrue(gm.isIdentityInLearningGroup(id2, g2.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id2, g3.getName())); // not a learning group
      assertFalse(gm.isIdentityInLearningGroup(id2, g4.getName())); // not a learning group

      DBFactory.getInstance().closeSession();
      assertTrue(gm.isIdentityInLearningGroup(id3, g1.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id3, g2.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id3, g3.getName())); // not a learning group
      assertFalse(gm.isIdentityInLearningGroup(id3, g4.getName())); // not a learning group

      assertTrue(gm.isIdentityInLearningGroup(id1, g1.getName(), c1.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id1, g1.getName(), c2.getName()));
      assertTrue(gm.isIdentityInLearningGroup(id3, g1.getName(), c1.getName()));
      assertFalse(gm.isIdentityInLearningGroup(id3, g1.getName(), c2.getName()));
View Full Code Here

Examples of org.olat.group.BusinessGroup

  List<Identity> getAllIdentitisFromGroupmanagement() {
    List<Identity> allUsersList = new ArrayList<Identity>();
    Manager secMgr = ManagerFactory.getManager();
    Iterator<BusinessGroup> iter = this.coachedGroups.iterator();
    while (iter.hasNext()) {
      BusinessGroup group = iter.next();
      SecurityGroup secGroup = group.getPartipiciantGroup();
      List<Identity> identities = secMgr.getIdentitiesOfSecurityGroup(secGroup);
      for (Iterator<Identity> identitiyIter = identities.iterator(); identitiyIter.hasNext();) {
        Identity identity = identitiyIter.next();
        if (!PersistenceHelper.listContainsObjectByKey(allUsersList, identity)) {
          // only add if not already in list
View Full Code Here

Examples of org.olat.group.BusinessGroup

   
    Translator defaultContextTranslator = new PackageTranslator(Util.getPackageName(BGContextTableModel.class), ureq.getLocale());
    // loop over all groups to filter depending on condition
    List<BusinessGroup> currentGroups = new ArrayList<BusinessGroup>();
    for (Iterator iter = this.coachedGroups.iterator(); iter.hasNext();) {
      BusinessGroup group = (BusinessGroup) iter.next();
      if ( !isFiltering || isVisibleAndAccessable(this.currentCourseNode, group) ) {
        currentGroups.add(group);
      }
    }
    GroupAndContextTableModel groupTableDataModel = new GroupAndContextTableModel(currentGroups, defaultContextTranslator);
View Full Code Here

Examples of org.olat.group.BusinessGroup

    setTools(STATE_USER_DETAILS);
  }

  private void doRemoveUserFromParticipatingGroup(Identity ureqIdentity, Identity toRemoveIdentity, String groupKey) {
    Long key = Long.valueOf(groupKey);
    BusinessGroup group = groupManager.loadBusinessGroup(key, true);
    List<Identity> identities = new ArrayList<Identity>(1);
    identities.add(toRemoveIdentity);
    groupManager.removeParticipantsAndFireEvent(ureqIdentity, identities, group, flags);
  }
View Full Code Here

Examples of org.olat.group.BusinessGroup

    groupManager.removeParticipantsAndFireEvent(ureqIdentity, identities, group, flags);
  }

  private void doRemoveUserFromOwnedGroup(UserRequest ureq, String groupKey) {
    Long key = Long.valueOf(groupKey);
    BusinessGroup group = groupManager.loadBusinessGroup(key, true);
    groupManager.removeOwnerAndFireEvent(ureq.getIdentity(), currentIdentity, group, flags, false);
  }
View Full Code Here

Examples of org.olat.group.BusinessGroup

    if (!added && !removed) return false;
    Long modKey = getModifiedGroupKey();

    if (added) {
      // load the business group and add it to the groups list
      BusinessGroup nGroup = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(modKey, true);
      // if (SyncHelper.)
      businessGroups.add(nGroup);
      return true;
    }
    // else : removed
    for (Iterator it_groups = businessGroups.iterator(); it_groups.hasNext();) {
      BusinessGroup group = (BusinessGroup) it_groups.next();
      if (modKey.equals(group.getKey())) {
        // our list is affected by the modified event
        it_groups.remove();
        return true;
      }
    }
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.