Package org.olat.group.context

Examples of org.olat.group.context.BGContext


      listenTo(cmc);
      cmc.activate();

    } else if (source == createGroupsLink) {
      // no groups in group management -> directly show group create dialog
      BGContext bgContext = getDefaultBGContext();
      String[] csvGroupName = easyGroupTE.isEmpty() ? new String[0] : easyGroupTE.getValue().split(",");
      // determine if bulkmode or not
      removeAsListenerAndDispose(groupCreateCntrllr);
      boolean bulkMode = csvGroupName.length > 1;
      groupCreateCntrllr = BGControllerFactory.getInstance().createNewBGController(ureq, getWindowControl(),  true,
          bgContext, bulkMode, easyGroupTE.getValue());
      listenTo(groupCreateCntrllr);

      //the main form gets overlayed -> hence do not mark as dirty
      //otherwise clicking any link in the overlay results in a
      //alert box -> "you have unsaved form data"
      //one has to listen for cmc closing events and then reactivate
      //dirty setting!! TODO:pb: find a better solution as this is error prone
      this.flc.getRootForm().setDirtyMarking(false);
      removeAsListenerAndDispose(cmc);
      cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCntrllr.getInitialComponent());
      listenTo(cmc);
      cmc.activate();

    } else if (source == chooseAreasLink) {
      // already areas -> choose areas
      removeAsListenerAndDispose(areaChooseC);
      areaChooseC = new GroupOrAreaSelectionController(1, getWindowControl(), ureq, "area", courseEditorEnv.getCourseGroupManager(),
          easyAreaTE.getValue());
      listenTo(areaChooseC);
     
      //the main form gets overlayed -> hence do not mark as dirty
      //otherwise clicking any link in the overlay results in a
      //alert box -> "you have unsaved form data"
      //one has to listen for cmc closing events and then reactivate
      //dirty setting!! TODO:pb: find a better solution as this is error prone
      this.flc.getRootForm().setDirtyMarking(false);
      removeAsListenerAndDispose(cmc);
      cmc = new CloseableModalController(getWindowControl(), "close", areaChooseC.getInitialComponent(), true, getTranslator().translate("popupchooseareas"));
      listenTo(cmc);
      cmc.activate();

    } else if (source == createAreasLink) {
      // no areas -> directly show creation dialog
      BGContext bgContext = getDefaultBGContext();
      removeAsListenerAndDispose(areaCreateCntrllr);
      String[] csvAreaName = easyAreaTE.isEmpty() ? new String[0] : easyAreaTE.getValue().split(",");
      // determine if bulkmode or not
      boolean bulkMode = csvAreaName.length > 1;
      areaCreateCntrllr = BGControllerFactory.getInstance().createNewAreaController(ureq, getWindowControl(),
          bgContext, bulkMode, easyAreaTE.getValue());
      listenTo(areaCreateCntrllr);

      //the main form gets overlayed -> hence do not mark as dirty
      //otherwise clicking any link in the overlay results in a
      //alert box -> "you have unsaved form data"
      //one has to listen for cmc closing events and then reactivate
      //dirty setting!! TODO:pb: find a better solution as this is error prone
      this.flc.getRootForm().setDirtyMarking(false);
      removeAsListenerAndDispose(cmc);
      cmc = new CloseableModalController(getWindowControl(), "close", areaCreateCntrllr.getInitialComponent());
      listenTo(cmc);
      cmc.activate();

    } else if (source == fixGroupError) {
      /*
       * user wants to fix problem with fixing group error link e.g. create one
       * or more group at once.
       */
      BGContext bgContext = getDefaultBGContext();
      if (groupCreateCntrllr != null) groupCreateCntrllr.dispose();
      String[] csvGroupName = (String[]) fixGroupError.getUserObject();
      // determine if bulkmode or not
      boolean bulkMode = csvGroupName.length > 1;
      removeAsListenerAndDispose(groupCreateCntrllr);
      groupCreateCntrllr = BGControllerFactory.getInstance().createNewBGController(ureq, getWindowControl(), true,
          bgContext, bulkMode, csvGroupName[0]);
      listenTo(groupCreateCntrllr);
     
      //the main form gets overlayed -> hence do not mark as dirty
      //otherwise clicking any link in the overlay results in a
      //alert box -> "you have unsaved form data"
      //one has to listen for cmc closing events and then reactivate
      //dirty setting!! TODO:pb: find a better solution as this is error prone
      this.flc.getRootForm().setDirtyMarking(false);
      removeAsListenerAndDispose(cmc);
      cmc = new CloseableModalController(getWindowControl(), "close", groupCreateCntrllr.getInitialComponent());
      listenTo(cmc);
      cmc.activate();
    } else if (source == fixAreaError) {
      /*
       * user wants to fix problem with fixing area error link e.g. create one
       * or more areas at once.
       */
      BGContext bgContext = getDefaultBGContext();
      removeAsListenerAndDispose(areaCreateCntrllr);
      String[] csvAreaName = (String[]) fixAreaError.getUserObject();
      // determine if bulkmode or not
      boolean bulkMode = csvAreaName.length > 1;
      areaCreateCntrllr = BGControllerFactory.getInstance().createNewAreaController(ureq, getWindowControl(),
View Full Code Here


   */
  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;
    // not found! -> disable easy creation of groups! (no workflows for choosing
    // contexts

View Full Code Here

   */
  public List<RepositoryEntry> getLearningResourcesAsStudent(Identity identity) {
    List<RepositoryEntry> allRepoEntries = new ArrayList<RepositoryEntry>();
    List<BusinessGroup>groupList = BusinessGroupManagerImpl.getInstance().findBusinessGroupsAttendedBy(BusinessGroup.TYPE_LEARNINGROUP, identity, null);
    for (BusinessGroup group : groupList) {
      BGContext bgContext = group.getGroupContext();
      if (bgContext == null) continue;
      List<RepositoryEntry> repoEntries = BGContextManagerImpl.getInstance().findRepositoryEntriesForBGContext(bgContext);
      if (repoEntries == null || repoEntries.size() == 0) continue;
      for (RepositoryEntry repositoryEntry : repoEntries) {
        if ( ! PersistenceHelper.listContainsObjectByKey(allRepoEntries, repositoryEntry)) {
View Full Code Here

  public List<RepositoryEntry> getLearningResourcesAsTeacher(Identity identity) {
    List<RepositoryEntry> allRepoEntries = new ArrayList<RepositoryEntry>();
    // 1: search for all learning groups where user is coach
    List<BusinessGroup>groupList = BusinessGroupManagerImpl.getInstance().findBusinessGroupsOwnedBy(BusinessGroup.TYPE_LEARNINGROUP, identity, null);
    for (BusinessGroup group : groupList) {
      BGContext bgContext = group.getGroupContext();
      if (bgContext == null) continue;
      List<RepositoryEntry> repoEntries = BGContextManagerImpl.getInstance().findRepositoryEntriesForBGContext(bgContext);
      if (repoEntries.size() == 0) continue;
      for (RepositoryEntry repositoryEntry : repoEntries) {
        if ( ! PersistenceHelper.listContainsObjectByKey(allRepoEntries, repositoryEntry)) {
View Full Code Here

    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);
    } else {
      // multiple, show list first
      Translator fallback = new PackageTranslator(Util.getPackageName(BGContextEditController.class), ureq.getLocale());
      setTranslator(Util.createPackageTranslator(this.getClass(), ureq.getLocale(), fallback));
View Full Code Here

    } else if (source == contextListCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        int rowid = te.getRowId();
        BGContext context = contextTableModel.getGroupContextAt(rowid);
        if (actionid.equals(CMD_CONTEXT_RUN)) {
          doInitGroupmanagement(ureq, context, true);
        }
      }
    } else if (source == toolC) {
View Full Code Here

   * find default context if one is present
   */
  private BGContext getDefaultBGContext() {
    List courseLGContextes = courseGrpMngr.getLearningGroupContexts();
    for (Iterator iter = courseLGContextes.iterator(); iter.hasNext();) {
      BGContext bctxt = (BGContext) iter.next();
      if (bctxt.isDefaultContext()) { return bctxt; }
    }
    return null;
    // not found! this is inacceptable! -> disable creation of groups!

  }
View Full Code Here

  private BusinessGroup doCopyGroup() {
    BusinessGroupManager groupManager = BusinessGroupManagerImpl.getInstance();
    // reload original group to prevent context proxy problems
    this.originalGroup = groupManager.loadBusinessGroup(this.originalGroup);
    BGContext bgContext = this.originalGroup.getGroupContext();
    String bgName = this.groupController.getGroupName();
    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());
View Full Code Here

   * @see org.olat.group.area.BGAreaManager#updateBGArea(org.olat.group.area.BGArea)
   */
  //o_clusterOK by:cg synchronized
  public BGArea updateBGArea(final BGArea area) {
    // look if an area with such a name does already exist in this context
    final BGContext groupContext = area.getGroupContext();
   
    BGArea updatedBGArea =CoordinatorManager.getCoordinator().getSyncer().doInSync(groupContext, new SyncerCallback<BGArea>(){
      public BGArea execute() {
        BGArea douplicate = findBGArea(area.getName(), groupContext);
        if (douplicate == null) {
View Full Code Here

  /**
   * @see org.olat.group.area.BGAreaManager#deleteBGArea(org.olat.group.area.BGArea)
   */
  // o_clusterOK by:cg must be synchronized too
  public void deleteBGArea(final BGArea area) {
    final BGContext groupContext = area.getGroupContext();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(groupContext, new SyncerExecutor(){
      public void execute() {
        BGArea reloadArea = findBGArea(area.getName(), groupContext);
        if (reloadArea != null) {
          // 1) delete all area - group relations
View Full Code Here

TOP

Related Classes of org.olat.group.context.BGContext

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.