Examples of BGContextManager


Examples of org.olat.group.context.BGContextManager

      super.setUp();
      DBFactory.getJunitInstance().clearDatabase();
      id1 = JunitTestHelper.createAndPersistIdentityAsUser("one");

      // create two test context
      BGContextManager bgcm = BGContextManagerImpl.getInstance();
      c1 = bgcm.createAndPersistBGContext("c1name", "c1desc", BusinessGroup.TYPE_LEARNINGROUP, null, true);
      c2 = bgcm.createAndPersistBGContext("c2name", "c2desc", BusinessGroup.TYPE_LEARNINGROUP, id1, false);
     
      DBFactory.getInstance().closeSession();
    } catch (Exception e) {
      log.error("Exception in setUp(): " + e);
      e.printStackTrace();
View Full Code Here

Examples of org.olat.group.context.BGContextManager

      throw new AssertException("Invalid group type ::" + groupType);
    }

    if (groupContexts.size() == 0) {
      // create new default context if none exists
      BGContextManager contextManager = BGContextManagerImpl.getInstance();
      OLATResource courseResource = OLATResourceManager.getInstance().findOrPersistResourceable(course);
      BGContext context = contextManager.createAndAddBGContextToResource(defaultContextName, courseResource, groupType, null, true);
      groupContexts.add(context);
      doInitGroupmanagement(ureq, context, false);
    } else if (groupContexts.size() == 1) {
      BGContext context = (BGContext) groupContexts.get(0);
      doInitGroupmanagement(ureq, context, false);
View Full Code Here

Examples of org.olat.group.context.BGContextManager

   * @see org.olat.instantMessaging.InstantMessaging#synchronizeLearningGroupsWithIMServer()
   */
  public boolean synchronizeLearningGroupsWithIMServer() {
    log.info("Starting synchronisation of LearningGroups with IM server");
    RepositoryManager rm = RepositoryManager.getInstance();
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    //pull as admin
    Roles roles = new Roles(true, true, true, true, false, true);
    List<RepositoryEntry> allCourses = rm.queryByTypeLimitAccess(CourseModule.getCourseTypeName(), roles);
    int counter = 0;
    for (Iterator<RepositoryEntry> iterator = allCourses.iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.olat.group.context.BGContextManager

   * @param groupContext
   * @return true if successfull, false if IM server is not running
   */
  public boolean synchronizeAllBuddyGroupsWithIMServer() {
      log.info("Started synchronisation of BuddyGroups with IM server.");
      BGContextManager cm = BGContextManagerImpl.getInstance();
      //null as argument pulls all buddygroups
      List<BusinessGroup> groups = cm.getGroupsOfBGContext(null);
      int counter = 0;
      for (Iterator<BusinessGroup> iter = groups.iterator(); iter.hasNext();) {
        BusinessGroup group = iter.next();
        synchonizeBuddyRoster(group);
        counter++;
View Full Code Here

Examples of org.olat.group.context.BGContextManager

    // TODO fg: export group rights

    // export groups
    MutableConfiguration confGroups = root.addChild(EXPORT_KEY_GROUP_COLLECTION);
    BGContextManager cm = BGContextManagerImpl.getInstance();
    List groups = cm.getGroupsOfBGContext(context);
    for (Iterator iter = groups.iterator(); iter.hasNext();) {
      BusinessGroup group = (BusinessGroup) iter.next();
      exportGroup(fExportFile, confGroups, group);
    }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

   */
  private String getAllLearningResourcesFor(BusinessGroup group) {
    // g
    StringBuilder learningResources = new StringBuilder();
    if (group.getGroupContext() != null) {
      BGContextManager contextManager = BGContextManagerImpl.getInstance();
      List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext());
      Iterator iter = repoEntries.iterator();
      while (iter.hasNext()) {
        RepositoryEntry entry = (RepositoryEntry) iter.next();
        String title = entry.getDisplayname();
        String url = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(entry);
View Full Code Here

Examples of org.olat.group.context.BGContextManager

   */
  private static MailTemplate createMailTemplate(BusinessGroup group, Identity actor, String subjectKey, String bodyKey) {
    // build learning resources as list of url as string
    StringBuilder learningResources = new StringBuilder();
    if (group.getGroupContext() != null) {
      BGContextManager contextManager = BGContextManagerImpl.getInstance();
      List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext());
      Iterator iter = repoEntries.iterator();
      while (iter.hasNext()) {
        RepositoryEntry entry = (RepositoryEntry) iter.next();
        String title = entry.getDisplayname();
        String url = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(entry);
View Full Code Here

Examples of org.olat.group.context.BGContextManager

        }
  }

  /** rights tests */
  public void testHasRightIsInMethods() {
      BGContextManager cm = BGContextManagerImpl.getInstance();
      BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
      Manager secm = ManagerFactory.getManager();
      BGRightManager rm = BGRightManagerImpl.getInstance();
      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());
View Full Code Here

Examples of org.olat.group.context.BGContextManager

    // 1) notify listeners of group events
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, group);
    // 2) notify listeners of learning resources of this group
    if (group.getGroupContext() != null) {
      if (group.getGroupContext() != null) {
        BGContextManager contextManager = BGContextManagerImpl.getInstance();
        List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext());
        Iterator iter = repoEntries.iterator();
        while (iter.hasNext()) {
          RepositoryEntry entry = (RepositoryEntry) iter.next();
          CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, entry);
        }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

                                                      // week
        msgProperties.setProperty("activeUsersLastWeek", String.valueOf(secMgr.countUniqueUserLoginsSince(lastLoginLimit.getTime())));
        lastLoginLimit.add(Calendar.MONTH, -1);
        msgProperties.setProperty("activeUsersLastMonth", String.valueOf(secMgr.countUniqueUserLoginsSince(lastLoginLimit.getTime())));
        // Groups
        BGContextManager groupMgr = BGContextManagerImpl.getInstance();
        int buddyGroups = groupMgr.countGroupsOfType(BusinessGroup.TYPE_BUDDYGROUP);
        msgProperties.setProperty("groupCountBuddyGroups", String.valueOf(buddyGroups));
        int learningGroups = groupMgr.countGroupsOfType(BusinessGroup.TYPE_LEARNINGROUP);
        msgProperties.setProperty("groupCountLearningGroups", String.valueOf(learningGroups));
        int rightGroups = groupMgr.countGroupsOfType(BusinessGroup.TYPE_RIGHTGROUP);
        msgProperties.setProperty("groupCountRightGroups", String.valueOf(rightGroups));
      }
      if (website) {
        // URL
        msgProperties.setProperty("websiteURL", Settings.getServerContextPathURI());
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.