use of org.olat.core.gui.control.generic.layout.MainLayoutController in project OpenOLAT by OpenOLAT.
the class IQManager method createIQDisplayController.
/**
* IMS QTI Display Controller used for IMS course node run view, or for the direct launching from learning resources.
*
* concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure)
*
* @param res
* @param resolver
* @param type
* @param secCallback
* @param ureq
* @param wControl
* @return
*/
public MainLayoutController createIQDisplayController(OLATResourceable res, Resolver resolver, String type, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl) {
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(res, OlatResourceableType.iq));
// -- 99% of cases -- 2) qti is ready to be run as test/survey
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)) {
LockResult lockEntry = CoordinatorManager.getInstance().getCoordinator().getLocker().aquirePersistentLock(res, ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockEntry.getOwner());
GenericMainController glc = createLockedMessageController(ureq, wControl, fullName);
return glc;
} else {
Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl);
// fxdiff BAKS-7 Resume function
OLATResourceableListeningWrapperController dwc = new OLATResourceableListeningWrapperController(ureq, wControl, res, controller, null, ureq.getIdentity());
return dwc;
}
}
use of org.olat.core.gui.control.generic.layout.MainLayoutController in project openolat by klemens.
the class IQManager method createIQDisplayController.
/**
* IMS QTI Display Controller used for IMS course node run view, or for the direct launching from learning resources.
*
* concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure)
*
* @param res
* @param resolver
* @param type
* @param secCallback
* @param ureq
* @param wControl
* @return
*/
public MainLayoutController createIQDisplayController(OLATResourceable res, Resolver resolver, String type, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl) {
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(res, OlatResourceableType.iq));
// -- 99% of cases -- 2) qti is ready to be run as test/survey
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)) {
LockResult lockEntry = CoordinatorManager.getInstance().getCoordinator().getLocker().aquirePersistentLock(res, ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockEntry.getOwner());
GenericMainController glc = createLockedMessageController(ureq, wControl, fullName);
return glc;
} else {
Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl);
// fxdiff BAKS-7 Resume function
OLATResourceableListeningWrapperController dwc = new OLATResourceableListeningWrapperController(ureq, wControl, res, controller, null, ureq.getIdentity());
return dwc;
}
}
use of org.olat.core.gui.control.generic.layout.MainLayoutController in project openolat by klemens.
the class AbstractSiteInstance method getAlternativeController.
protected MainLayoutController getAlternativeController(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
String altControllerId = config.getAlternativeControllerBeanId();
MainLayoutController c;
if (StringHelper.containsNonWhitespace(altControllerId)) {
AutoCreator creator = (AutoCreator) CoreSpringFactory.getBean(altControllerId);
Controller ac = creator.createController(ureq, wControl);
if (ac instanceof MainLayoutController) {
c = (MainLayoutController) ac;
} else {
c = new LayoutMain3ColsController(ureq, wControl, ac);
}
} else {
Controller ctrl = new ForbiddenCourseSiteController(ureq, wControl);
c = new LayoutMain3ColsController(ureq, wControl, ctrl);
}
return c;
}
Aggregations