Search in sources :

Example 86 with WindowControl

use of org.olat.core.gui.control.WindowControl 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 87 with WindowControl

use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.

the class UserInfoMainController method doOpenContact.

private ContactFormController doOpenContact(UserRequest ureq) {
    removeAsListenerAndDispose(contactFormController);
    ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
    ContactList emailList = new ContactList(firstLastName);
    emailList.add(chosenIdentity);
    cmsg.addEmailTo(emailList);
    OLATResourceable ores = OresHelper.createOLATResourceableType(CMD_CONTACT);
    WindowControl bwControl = addToHistory(ureq, ores, null);
    contactFormController = new ContactFormController(ureq, bwControl, true, false, false, cmsg);
    listenTo(contactFormController);
    return contactFormController;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) WindowControl(org.olat.core.gui.control.WindowControl) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 88 with WindowControl

use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.

the class UserInfoMainController method doOpenCalendar.

private WeeklyCalendarController doOpenCalendar(UserRequest ureq) {
    removeAsListenerAndDispose(calendarController);
    KalendarRenderWrapper calendarWrapper = calendarManager.getPersonalCalendar(chosenIdentity);
    CalendarUserConfiguration config = calendarManager.findCalendarConfigForIdentity(calendarWrapper.getKalendar(), getIdentity());
    if (config != null) {
        calendarWrapper.setConfiguration(config);
    }
    calendarWrapper.setPrivateEventsVisible(chosenIdentity.equals(ureq.getIdentity()));
    if (chosenIdentity.equals(ureq.getIdentity())) {
        calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_WRITE);
    } else {
        calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
    }
    List<KalendarRenderWrapper> calendars = new ArrayList<KalendarRenderWrapper>();
    calendars.add(calendarWrapper);
    OLATResourceable ores = OresHelper.createOLATResourceableType(CMD_CALENDAR);
    WindowControl bwControl = addToHistory(ureq, ores, null);
    OLATResourceable callerOres = OresHelper.createOLATResourceableInstance(chosenIdentity.getName(), chosenIdentity.getKey());
    calendarController = new WeeklyCalendarController(ureq, bwControl, calendars, WeeklyCalendarController.CALLER_PROFILE, callerOres, false);
    listenTo(calendarController);
    return calendarController;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) ArrayList(java.util.ArrayList) WeeklyCalendarController(org.olat.commons.calendar.ui.WeeklyCalendarController) CalendarUserConfiguration(org.olat.commons.calendar.model.CalendarUserConfiguration) KalendarRenderWrapper(org.olat.commons.calendar.ui.components.KalendarRenderWrapper) WindowControl(org.olat.core.gui.control.WindowControl)

Example 89 with WindowControl

use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.

the class UserInfoMainController method doOpenFolder.

private FolderRunController doOpenFolder(UserRequest ureq) {
    removeAsListenerAndDispose(folderRunController);
    String chosenUserFolderRelPath = FolderConfig.getUserHome(chosenIdentity.getName()) + "/public";
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
    OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
    // decided in plenum to have read only view in the personal visiting card, even for admin
    VFSSecurityCallback secCallback = new ReadOnlyCallback();
    namedFolder.setLocalSecurityCallback(secCallback);
    OLATResourceable ores = OresHelper.createOLATResourceableType("userfolder");
    WindowControl bwControl = addToHistory(ureq, ores, null);
    folderRunController = new FolderRunController(namedFolder, false, true, false, ureq, bwControl);
    folderRunController.setResourceURL("[Identity:" + chosenIdentity.getKey() + "][userfolder:0]");
    listenTo(folderRunController);
    return folderRunController;
}
Also used : OlatNamedContainerImpl(org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) ReadOnlyCallback(org.olat.core.util.vfs.callbacks.ReadOnlyCallback) OLATResourceable(org.olat.core.id.OLATResourceable) FolderRunController(org.olat.core.commons.modules.bc.FolderRunController) WindowControl(org.olat.core.gui.control.WindowControl) VFSSecurityCallback(org.olat.core.util.vfs.callbacks.VFSSecurityCallback)

Example 90 with WindowControl

use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.

the class UserInterestsElement method doEdit.

private void doEdit(UserRequest ureq) {
    ChiefController chief = Windows.getWindows(ureq).getChiefController();
    WindowControl wControl = chief.getWindowControl();
    if (wControl != null) {
        List<UserInterestsCategory> availableUserInterests = UserInterestsPropertyHandler.loadAvailableUserInterests();
        userInterestsController = new UserInterestsController(ureq, wControl, getSelectedInterestsIDs(), availableUserInterests);
        userInterestsController.addControllerListener(this);
        String title = getTranslator().translate("userinterests.title");
        modalController = new CloseableModalController(wControl, "close", userInterestsController.getInitialComponent(), true, title);
        modalController.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ChiefController(org.olat.core.gui.control.ChiefController) WindowControl(org.olat.core.gui.control.WindowControl)

Aggregations

WindowControl (org.olat.core.gui.control.WindowControl)628 OLATResourceable (org.olat.core.id.OLATResourceable)300 UserRequest (org.olat.core.gui.UserRequest)136 Controller (org.olat.core.gui.control.Controller)70 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)68 RepositoryEntry (org.olat.repository.RepositoryEntry)68 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)64 ContextEntry (org.olat.core.id.context.ContextEntry)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 BusinessControl (org.olat.core.id.context.BusinessControl)56 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)46 ArrayList (java.util.ArrayList)42 Identity (org.olat.core.id.Identity)38 StateSite (org.olat.core.id.context.StateSite)32 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)28 AssertException (org.olat.core.logging.AssertException)24 QuestionsController (org.olat.modules.qpool.ui.QuestionsController)22 List (java.util.List)20