Search in sources :

Example 1 with BusinessGroupMainRunController

use of org.olat.group.ui.run.BusinessGroupMainRunController in project OpenOLAT by OpenOLAT.

the class BGControllerFactory method createRunControllerFor.

// 
// 2) Group run controllers
// 
/**
 * Factory method to create a configured group run controller
 *
 * @param ureq
 * @param wControl
 * @param businessGroup
 * @param isGMAdmin true if user is group management administrator
 * @param initialViewIdentifier
 * @return a run controller for this business group
 */
public BusinessGroupMainRunController createRunControllerFor(UserRequest ureq, WindowControl wControl, BusinessGroup businessGroup) {
    // build up the context path
    WindowControl bwControl;
    OLATResourceable businessOres = businessGroup;
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(businessOres);
    // OLAT-5944: check if the current context entry is not already the group entry to avoid duplicate in the business path
    if (ce.equals(wControl.getBusinessControl().getCurrentContextEntry())) {
        bwControl = wControl;
    } else {
        bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
    }
    return new BusinessGroupMainRunController(ureq, bwControl, businessGroup);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry) BusinessGroupMainRunController(org.olat.group.ui.run.BusinessGroupMainRunController)

Example 2 with BusinessGroupMainRunController

use of org.olat.group.ui.run.BusinessGroupMainRunController in project openolat by klemens.

the class BGControllerFactory method createRunControllerFor.

// 
// 2) Group run controllers
// 
/**
 * Factory method to create a configured group run controller
 *
 * @param ureq
 * @param wControl
 * @param businessGroup
 * @param isGMAdmin true if user is group management administrator
 * @param initialViewIdentifier
 * @return a run controller for this business group
 */
public BusinessGroupMainRunController createRunControllerFor(UserRequest ureq, WindowControl wControl, BusinessGroup businessGroup) {
    // build up the context path
    WindowControl bwControl;
    OLATResourceable businessOres = businessGroup;
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(businessOres);
    // OLAT-5944: check if the current context entry is not already the group entry to avoid duplicate in the business path
    if (ce.equals(wControl.getBusinessControl().getCurrentContextEntry())) {
        bwControl = wControl;
    } else {
        bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
    }
    return new BusinessGroupMainRunController(ureq, bwControl, businessGroup);
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry) BusinessGroupMainRunController(org.olat.group.ui.run.BusinessGroupMainRunController)

Aggregations

WindowControl (org.olat.core.gui.control.WindowControl)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 BusinessGroupMainRunController (org.olat.group.ui.run.BusinessGroupMainRunController)2