Examples of BGContextManager


Examples of org.olat.group.context.BGContextManager

  /**
   * persist the updates
   */
  private void doUpdateContext(UserRequest ureq) {
    // refresh group to prevent stale object exception and context proxy issues
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    this.groupContext = contextManager.loadBGContext(this.groupContext);
    // update defaultContext switch changes
    if (ureq.getUserSession().getRoles().isOLATAdmin()) {
      boolean newisDefaultContext = this.contextController.isDefaultContext();
      if (newisDefaultContext) {
        if (this.repoTableModelEntries.size() == 0) {
          getWindowControl().setError(translate("form.error.defaultButNoResource"));
          this.contextController.setValues(this.groupContext);
          return;
        }
      }
      this.groupContext.setDefaultContext(newisDefaultContext);
    }
    // update name and descripton
    String name = this.contextController.getName();
    String desc = this.contextController.getDescription();
    this.groupContext.setName(name);
    this.groupContext.setDescription(desc);
    contextManager.updateBGContext(this.groupContext);
    // update velocity
    String title = DefaultContextTranslationHelper.translateIfDefaultContextName(this.groupContext, getTranslator());
    this.editVC.contextPut("title", getTranslator().translate("edit.title", new String[] { "<i>" + StringEscapeUtils.escapeHtml(title) + "</i>" }));
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

    this.editVC.contextPut("title", getTranslator().translate("edit.title", new String[] { "<i>" + StringEscapeUtils.escapeHtml(title) + "</i>" }));
  }
 
  private void doRemoveResource(RepositoryEntry entry) {
    // remove on db
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    contextManager.removeBGContextFromResource(this.groupContext, entry.getOlatResource());
    // remove on table model
    this.repoTableModelEntries.remove(entry);
    this.resourcesCtr.modelChanged();
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

    this.resourcesCtr.modelChanged();
  }

  private void doAddRepositoryEntry(RepositoryEntry entry) {
    // persist on db
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    contextManager.addBGContextToResource(this.groupContext, entry.getOlatResource());
    // update table model
    this.repoTableModelEntries.add(entry);
    this.resourcesCtr.modelChanged();
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

      this.tabResourcesVC = createVelocityContainer("tab_resources");
      this.addTabResourcesButton = LinkFactory.createButtonSmall("cmd.addresource", this.tabResourcesVC, this);
    }

    this.repoTableModel = new RepositoryTableModel(resourceTrans);
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    this.repoTableModelEntries = contextManager.findRepositoryEntriesForBGContext(this.groupContext);
    this.repoTableModel.setEntries(this.repoTableModelEntries);
    if (!initOnlyModel) {
      this.repoTableModel.addColumnDescriptors(this.resourcesCtr, translate("resources.remove"), false);
    }
    this.resourcesCtr.setTableDataModel(this.repoTableModel);
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  }

  private void doShowResources(UserRequest ureq) {
    // always refresh data model, maybe it has changed
    RepositoryTableModel repoTableModel = new RepositoryTableModel(resourceTrans);
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    List repoTableModelEntries = contextManager.findRepositoryEntriesForBGContext(businessGroup.getGroupContext());
    repoTableModel.setEntries(repoTableModelEntries);
    // init table controller only once
    if (resourcesCtr == null) {
      TableGuiConfiguration tableConfig = new TableGuiConfiguration();
      tableConfig.setTableEmptyMessage(translate("resources.noresources"));
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#initGroupContextsList()
   */
  public void initGroupContextsList() {
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    learningGroupContexts = contextManager.findBGContextsForResource(courseResource, BusinessGroup.TYPE_LEARNINGROUP, true, true);
    rightGroupContexts = contextManager.findBGContextsForResource(courseResource, BusinessGroup.TYPE_RIGHTGROUP, true, true);
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#isIdentityInGroupContext(org.olat.core.id.Identity,
   *      java.lang.String)
   */
  public boolean isIdentityInGroupContext(Identity identity, String groupContextName) {
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    Iterator iter = learningGroupContexts.iterator();
    while (iter.hasNext()) {
      BGContext context = (BGContext) iter.next();
      if (groupContextName == null || context.getName().equals(groupContextName)) {
        boolean inContext = contextManager.isIdentityInBGContext(identity, context, true, true);
        if (inContext) return true; // finished
      }
    }
    iter = rightGroupContexts.iterator();
    while (iter.hasNext()) {
      BGContext context = (BGContext) iter.next();
      if (groupContextName == null || context.getName().equals(groupContextName)) {
        boolean inContext = contextManager.isIdentityInBGContext(identity, context, true, true);
        if (inContext) return true; // finished
      }
    }
    return false;
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getRightGroupsFromAllContexts(java.lang.String)
   */
  public List getRightGroupsFromAllContexts(String groupName) {
    List groups = new ArrayList();
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    Iterator iterator = rightGroupContexts.iterator();
    while (iterator.hasNext()) {
      BGContext bgContext = (BGContext) iterator.next();
      BusinessGroup group = contextManager.findGroupOfBGContext(groupName, bgContext);
      if (group != null) groups.add(group);
    }
    return groups;
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getAllLearningGroupsFromAllContexts()
   */
  public List getAllLearningGroupsFromAllContexts() {
    List allGroups = new ArrayList();
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    Iterator iterator = learningGroupContexts.iterator();
    while (iterator.hasNext()) {
      BGContext bgContext = (BGContext) iterator.next();
      List contextGroups = contextManager.getGroupsOfBGContext(bgContext);
      allGroups.addAll(contextGroups);
    }
    return allGroups;
  }
View Full Code Here

Examples of org.olat.group.context.BGContextManager

  /**
   * @see org.olat.course.groupsandrights.CourseGroupManager#getLearningGroupsFromAllContexts(java.lang.String)
   */
  public List getLearningGroupsFromAllContexts(String groupName) {
    List groups = new ArrayList();
    BGContextManager contextManager = BGContextManagerImpl.getInstance();
    Iterator iterator = learningGroupContexts.iterator();
    while (iterator.hasNext()) {
      BGContext bgContext = (BGContext) iterator.next();
      BusinessGroup group = contextManager.findGroupOfBGContext(groupName, bgContext);
      if (group != null) groups.add(group);
    }
    return groups;
  }
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.