Search in sources :

Example 16 with MainLayoutController

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;
    }
}
Also used : LockResult(org.olat.core.util.coordinate.LockResult) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) OLATResourceableListeningWrapperController(org.olat.core.util.controller.OLATResourceableListeningWrapperController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) IQEditController(org.olat.course.nodes.iq.IQEditController) OLATResourceableListeningWrapperController(org.olat.core.util.controller.OLATResourceableListeningWrapperController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller)

Example 17 with MainLayoutController

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;
    }
}
Also used : LockResult(org.olat.core.util.coordinate.LockResult) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) OLATResourceableListeningWrapperController(org.olat.core.util.controller.OLATResourceableListeningWrapperController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) IQEditController(org.olat.course.nodes.iq.IQEditController) OLATResourceableListeningWrapperController(org.olat.core.util.controller.OLATResourceableListeningWrapperController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller)

Example 18 with MainLayoutController

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;
}
Also used : AutoCreator(org.olat.core.gui.control.creator.AutoCreator) ForbiddenCourseSiteController(org.olat.course.site.ui.ForbiddenCourseSiteController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) ForbiddenCourseSiteController(org.olat.course.site.ui.ForbiddenCourseSiteController) Controller(org.olat.core.gui.control.Controller) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController)

Aggregations

MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)18 Controller (org.olat.core.gui.control.Controller)14 WindowControl (org.olat.core.gui.control.WindowControl)14 RepositoryEntrySecurity (org.olat.repository.model.RepositoryEntrySecurity)12 UserRequest (org.olat.core.gui.UserRequest)10 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)10 AssessmentMode (org.olat.course.assessment.AssessmentMode)10 RepositoryEntry (org.olat.repository.RepositoryEntry)10 RuntimeControllerCreator (org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator)10 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)8 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)6 OLATResourceable (org.olat.core.id.OLATResourceable)6 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)5 ContextEntry (org.olat.core.id.context.ContextEntry)4 StateSite (org.olat.core.id.context.StateSite)4 UserSession (org.olat.core.util.UserSession)4 OLATResourceableListeningWrapperController (org.olat.core.util.controller.OLATResourceableListeningWrapperController)4 FeedResourceSecurityCallback (org.olat.modules.webFeed.FeedResourceSecurityCallback)4 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)4 FeedMainController (org.olat.modules.webFeed.ui.FeedMainController)4