Package org.olat.group

Examples of org.olat.group.BusinessGroupManager


      log.audit("+---------------------------------------------------------------+");
      log.audit("+...     " + TASK_MIGRATE_WIKICODE_BG_DESC + "     ...+");
      log.audit("+---------------------------------------------------------------+");

      int bgcounter = 0;     
      BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
      List<BusinessGroup> allGroups = bgm.getAllBusinessGroups();
      if (log.isDebug()) log.info("Migrating " + allGroups.size() + " BusinessGroups.");

      if (allGroups != null && allGroups.size() != 0) {
        for (BusinessGroup group : allGroups) {
          try{
            String oldDesc = group.getDescription();
            if (StringHelper.containsNonWhitespace(oldDesc)) {
              String newDesc = migrateStringSavely(oldDesc);
              group.setDescription(newDesc);
              bgm.updateBusinessGroup(group);
              bgcounter++;
            }
            DBFactory.getInstance().intermediateCommit();
          } catch (Exception e) {
            log.error("Error during Migration: "+e, e);
View Full Code Here


  protected void setUp() throws Exception {
    super.setUp();
    if (EnrollmentManagerTest.isInitialized == false) {
      try {
        DBFactory.getJunitInstance().clearDatabase();
        BusinessGroupManager bgManager = BusinessGroupManagerImpl.getInstance();
        // Identities
        id1 = ManagerFactory.getManager().createAndPersistIdentity("id1", null, OLATAuthenticationController.PROVIDER_OLAT, "id1",
            Encoder.encrypt("id1"));

        DBFactory.getInstance().closeSession();
View Full Code Here

      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BuddyGroupMainController, but is in guest group " + roles);
      return BGControllerFactory.getInstance().createBuddyGroupMainController(ureq, wControl, initialViewIdentifier);

    } else if (OresHelper.isOfType(olatResourceable, BusinessGroup.class)) {
      if (roles.isGuestOnly()) throw new OLATSecurityException("Tried to launch a BusinessGroup, but is in guest group " + roles);
      BusinessGroupManager bgm = BusinessGroupManagerImpl.getInstance();
      BusinessGroup bg = bgm.loadBusinessGroup(olatResourceable.getResourceableId(), exceptIfNoneFound);
      boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
      // check if allowed to start (must be member or admin)
      if (isOlatAdmin || bgm.isIdentityInBusinessGroup(ureq.getIdentity(), bg)) { 
        // only olatadmins or admins of this group can administer this group
        return BGControllerFactory.getInstance().createRunControllerFor(ureq, wControl, bg, isOlatAdmin,
            initialViewIdentifier);
      }
      // else skip
View Full Code Here

TOP

Related Classes of org.olat.group.BusinessGroupManager

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.