Search in sources :

Example 61 with UserRequest

use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.

the class QTIEditorMainController method doImportTable.

private void doImportTable(UserRequest ureq) {
    removeAsListenerAndDispose(importTableWizard);
    final ItemsPackage importPackage = new ItemsPackage();
    final ImportOptions options = new ImportOptions();
    options.setShuffle(!qtiPackage.getQTIDocument().isSurvey());
    Step start = new QImport_1_InputStep(ureq, importPackage, options, null);
    StepRunnerCallback finish = new StepRunnerCallback() {

        @Override
        public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
            runContext.put("importPackage", importPackage);
            return StepsMainRunController.DONE_MODIFIED;
        }
    };
    importTableWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("tools.import.table"), "o_mi_table_import_wizard");
    listenTo(importTableWizard);
    getWindowControl().pushAsModalDialog(importTableWizard.getInitialComponent());
}
Also used : StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) QImport_1_InputStep(org.olat.ims.qti.questionimport.QImport_1_InputStep) Step(org.olat.core.gui.control.generic.wizard.Step) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) ItemsPackage(org.olat.ims.qti.questionimport.ItemsPackage) ImportOptions(org.olat.ims.qti.questionimport.ImportOptions) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest) QImport_1_InputStep(org.olat.ims.qti.questionimport.QImport_1_InputStep)

Example 62 with UserRequest

use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.

the class GoToMeetingController method doJoin.

private void doJoin(UserRequest ureq) {
    boolean join = false;
    GoToError error = new GoToError();
    if (registrant == null) {
        registrant = meetingMgr.registerTraining(meeting, getIdentity(), error);
    }
    if (registrant != null) {
        String joinUrl = registrant.getJoinUrl();
        if (joinUrl != null) {
            RedirectMediaResource redirect = new RedirectMediaResource(joinUrl);
            ureq.getDispatchResult().setResultingMediaResource(redirect);
            join = true;
        }
    }
    if (!join) {
        final String errorMessage;
        if (error.hasError()) {
            if (error.getError() != null) {
                errorMessage = translate(error.getError().i18nKey());
            } else {
                errorMessage = translate("error.code.unkown");
            }
        } else {
            errorMessage = translate("error.code.unkown");
        }
        ControllerCreator creator = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {

            @Override
            public Controller createController(UserRequest lureq, WindowControl lwControl) {
                // Wrap in column layout, popup window needs a layout controller
                String title = "";
                String text = errorMessage;
                Controller ctr = MessageUIFactory.createErrorMessage(lureq, lwControl, title, text);
                LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
                layoutCtr.addDisposableChildController(ctr);
                return layoutCtr;
            }
        });
        openInNewBrowserWindow(ureq, creator);
    }
    updateButtons();
}
Also used : GoToError(org.olat.modules.gotomeeting.model.GoToError) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) WindowControl(org.olat.core.gui.control.WindowControl) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 63 with UserRequest

use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.

the class IQManager method createLockedMessageController.

private GenericMainController createLockedMessageController(UserRequest ureq, WindowControl wControl, String fullName) {
    // wrap simple message into mainLayout
    GenericMainController glc = new GenericMainController(ureq, wControl) {

        @Override
        public void init(UserRequest uureq) {
            Panel empty = new Panel("empty");
            setTranslator(Util.createPackageTranslator(this.getClass(), uureq.getLocale()));
            Controller contentCtr = MessageUIFactory.createInfoMessage(uureq, getWindowControl(), translate("status.currently.locked.title"), translate("status.currently.locked", fullName));
            // auto dispose later
            listenTo(contentCtr);
            Component resComp = contentCtr.getInitialComponent();
            LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(uureq, getWindowControl(), empty, resComp, /*do not save no prefs*/
            null);
            // auto dispose later
            listenTo(columnLayoutCtr);
            putInitialPanel(columnLayoutCtr.getInitialComponent());
        }

        @Override
        protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest uureq) {
            // no menutree means no menu events.
            return null;
        }
    };
    glc.init(ureq);
    return glc;
}
Also used : Panel(org.olat.core.gui.components.panel.Panel) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) 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) Component(org.olat.core.gui.components.Component) UserRequest(org.olat.core.gui.UserRequest)

Example 64 with UserRequest

use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.

the class QuickstartPortletRunController method event.

public void event(UserRequest ureq, Component source, Event event) {
    if (source == quickstartVC) {
        String cmd = event.getCommand();
        String businessPath = null;
        if (cmd.equals("cmd.repo.course")) {
            businessPath = "[MyCoursesSite:0]";
        } else if (cmd.equals("cmd.repo.catalog")) {
            businessPath = "[MyCoursesSite:0][Catalog:0]";
        } else if (cmd.equals("cmd.settings")) {
            businessPath = "[HomeSite:" + ureq.getIdentity().getKey() + "][mysettings:0]";
        } else if (cmd.equals("cmd.buddygroup.new")) {
            businessPath = "[GroupsSite:0]";
        }
        if (StringHelper.containsNonWhitespace(businessPath)) {
            NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
        }
    } else if (source == helpLink) {
        ControllerCreator ctrlCreator = new ControllerCreator() {

            public Controller createController(UserRequest lureq, WindowControl lwControl) {
                return CourseFactory.createHelpCourseLaunchController(lureq, lwControl);
            }
        };
        // wrap the content controller into a full header layout
        ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
        // open in new browser window
        PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
        pbw.open(ureq);
    // 
    }
}
Also used : PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) WindowControl(org.olat.core.gui.control.WindowControl) Controller(org.olat.core.gui.control.Controller) DefaultController(org.olat.core.gui.control.DefaultController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 65 with UserRequest

use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.

the class OlatFooterController method doOpenImpressum.

protected void doOpenImpressum(UserRequest ureq) {
    ControllerCreator impressumControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            return new ImpressumMainController(lureq, lwControl);
        }
    };
    PopupBrowserWindow popupBrowserWindow;
    if (ureq.getUserSession().isAuthenticated()) {
        popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, impressumControllerCreator);
    } else {
        popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewUnauthenticatedPopupWindowFor(ureq, impressumControllerCreator);
    }
    popupBrowserWindow.open(ureq);
}
Also used : PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) ImpressumMainController(org.olat.core.commons.controllers.impressum.ImpressumMainController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

UserRequest (org.olat.core.gui.UserRequest)314 WindowControl (org.olat.core.gui.control.WindowControl)154 Identity (org.olat.core.id.Identity)92 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)74 RestSecurityHelper.getUserRequest (org.olat.restapi.security.RestSecurityHelper.getUserRequest)68 Path (javax.ws.rs.Path)64 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)64 Controller (org.olat.core.gui.control.Controller)62 RepositoryEntry (org.olat.repository.RepositoryEntry)58 Step (org.olat.core.gui.control.generic.wizard.Step)56 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)56 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)56 ArrayList (java.util.ArrayList)46 ICourse (org.olat.course.ICourse)44 Produces (javax.ws.rs.Produces)40 List (java.util.List)36 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)36 PUT (javax.ws.rs.PUT)32 UserRequestImpl (org.olat.core.gui.UserRequestImpl)30 RestSecurityHelper.getIdentity (org.olat.restapi.security.RestSecurityHelper.getIdentity)30