Search in sources :

Example 11 with PopupBrowserWindow

use of org.olat.core.gui.control.generic.popup.PopupBrowserWindow in project openolat by klemens.

the class EfficiencyStatementsPortletRunController method event.

/**
 * @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Controller source, Event event) {
    super.event(ureq, source, event);
    if (source == tableCtr) {
        if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
            TableEvent te = (TableEvent) event;
            String actionid = te.getActionId();
            if (actionid.equals(CMD_LAUNCH)) {
                int rowid = te.getRowId();
                final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
                // will not be disposed on course run dispose, popus up as new browserwindow
                ControllerCreator ctrlCreator = new ControllerCreator() {

                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
                        return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
                    }
                };
                // 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 : TableEvent(org.olat.core.gui.components.table.TableEvent) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) UserEfficiencyStatementLight(org.olat.course.assessment.model.UserEfficiencyStatementLight) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 12 with PopupBrowserWindow

use of org.olat.core.gui.control.generic.popup.PopupBrowserWindow in project openolat by klemens.

the class RichTextElementComponent method createFileSelectorPopupWindow.

private void createFileSelectorPopupWindow(final UserRequest ureq, final String type, final String fileName) {
    // Get allowed suffixes from configuration and requested media browser type from event
    final RichTextConfiguration config = element.getEditorConfiguration();
    final boolean allowCustomMediaFactory = config.isAllowCustomMediaFactory();
    final boolean uriValidation = config.isFilenameUriValidation();
    final String[] suffixes;
    if (type.equals(CMD_FILEBROWSER)) {
        suffixes = null;
    } else if (type.equals(CMD_IMAGEBROWSER)) {
        suffixes = config.getLinkBrowserImageSuffixes();
    } else if (type.equals(CMD_FLASHPLAYERBROWSER)) {
        suffixes = config.getLinkBrowserFlashPlayerSuffixes();
    } else {
        suffixes = config.getLinkBrowserMediaSuffixes();
    }
    // Show popup window with file browser to select file
    // Only one popup file chooser allowed at any time. ccc contains icc,
    // icc gets disposed by ccc
    // helper code which is used to create link chooser controller
    ControllerCreator linkChooserControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            LinkChooserController myLinkChooserController;
            VFSContainer baseContainer = config.getLinkBrowserBaseContainer();
            String uploadRelPath = config.getLinkBrowserUploadRelPath();
            String absolutePath = config.getLinkBrowserAbsolutFilePath();
            CustomLinkTreeModel linkBrowserCustomTreeModel = config.getLinkBrowserCustomLinkTreeModel();
            if (type.equals(CMD_FILEBROWSER)) {
                // when in file mode we include the internal links to the selection
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, linkBrowserCustomTreeModel, allowCustomMediaFactory);
            } else {
                // in media or image mode, internal links make no sense here
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, null, allowCustomMediaFactory);
            }
            return new LayoutMain3ColsController(lureq, lwControl, myLinkChooserController);
        }
    };
    PopupBrowserWindow pbw = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, linkChooserControllerCreator);
    pbw.open(ureq);
}
Also used : CustomLinkTreeModel(org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel) LinkChooserController(org.olat.core.commons.controllers.linkchooser.LinkChooserController) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) VFSContainer(org.olat.core.util.vfs.VFSContainer) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 13 with PopupBrowserWindow

use of org.olat.core.gui.control.generic.popup.PopupBrowserWindow in project OpenOLAT by OpenOLAT.

the class RichTextElementComponent method createFileSelectorPopupWindow.

private void createFileSelectorPopupWindow(final UserRequest ureq, final String type, final String fileName) {
    // Get allowed suffixes from configuration and requested media browser type from event
    final RichTextConfiguration config = element.getEditorConfiguration();
    final boolean allowCustomMediaFactory = config.isAllowCustomMediaFactory();
    final boolean uriValidation = config.isFilenameUriValidation();
    final String[] suffixes;
    if (type.equals(CMD_FILEBROWSER)) {
        suffixes = null;
    } else if (type.equals(CMD_IMAGEBROWSER)) {
        suffixes = config.getLinkBrowserImageSuffixes();
    } else if (type.equals(CMD_FLASHPLAYERBROWSER)) {
        suffixes = config.getLinkBrowserFlashPlayerSuffixes();
    } else {
        suffixes = config.getLinkBrowserMediaSuffixes();
    }
    // Show popup window with file browser to select file
    // Only one popup file chooser allowed at any time. ccc contains icc,
    // icc gets disposed by ccc
    // helper code which is used to create link chooser controller
    ControllerCreator linkChooserControllerCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            LinkChooserController myLinkChooserController;
            VFSContainer baseContainer = config.getLinkBrowserBaseContainer();
            String uploadRelPath = config.getLinkBrowserUploadRelPath();
            String absolutePath = config.getLinkBrowserAbsolutFilePath();
            CustomLinkTreeModel linkBrowserCustomTreeModel = config.getLinkBrowserCustomLinkTreeModel();
            if (type.equals(CMD_FILEBROWSER)) {
                // when in file mode we include the internal links to the selection
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, linkBrowserCustomTreeModel, allowCustomMediaFactory);
            } else {
                // in media or image mode, internal links make no sense here
                myLinkChooserController = new LinkChooserController(lureq, lwControl, baseContainer, uploadRelPath, absolutePath, suffixes, uriValidation, fileName, null, allowCustomMediaFactory);
            }
            return new LayoutMain3ColsController(lureq, lwControl, myLinkChooserController);
        }
    };
    PopupBrowserWindow pbw = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, linkChooserControllerCreator);
    pbw.open(ureq);
}
Also used : CustomLinkTreeModel(org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel) LinkChooserController(org.olat.core.commons.controllers.linkchooser.LinkChooserController) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) VFSContainer(org.olat.core.util.vfs.VFSContainer) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 14 with PopupBrowserWindow

use of org.olat.core.gui.control.generic.popup.PopupBrowserWindow in project OpenOLAT by OpenOLAT.

the class CourseRuntimeController method launchCalendar.

private void launchCalendar(UserRequest ureq) {
    ControllerCreator ctrlCreator = new ControllerCreator() {

        @Override
        public Controller createController(UserRequest lureq, WindowControl lwControl) {
            ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
            ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(getRepositoryEntry());
            WindowControl llwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, lwControl);
            CourseCalendarController calendarController = new CourseCalendarController(lureq, llwControl, getUserCourseEnvironment());
            // use a one-column main layout
            LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, llwControl, calendarController);
            layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), course.getCourseEnvironment()));
            // dispose calendar on layout dispose
            layoutCtr.addDisposableChildController(calendarController);
            return layoutCtr;
        }
    };
    // 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) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ICourse(org.olat.course.ICourse) WindowControl(org.olat.core.gui.control.WindowControl) CourseCalendarController(org.olat.course.run.calendar.CourseCalendarController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 15 with PopupBrowserWindow

use of org.olat.core.gui.control.generic.popup.PopupBrowserWindow in project OpenOLAT by OpenOLAT.

the class OlatDmzTopNavController method doImpressum.

private void doImpressum(UserRequest ureq) {
    ControllerCreator impressumControllerCreator = new ControllerCreator() {

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

Aggregations

PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)30 UserRequest (org.olat.core.gui.UserRequest)28 WindowControl (org.olat.core.gui.control.WindowControl)28 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)28 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)10 TableEvent (org.olat.core.gui.components.table.TableEvent)10 UserInfoMainController (org.olat.user.UserInfoMainController)8 ArrayList (java.util.ArrayList)6 List (java.util.List)6 SingleIdentityChosenEvent (org.olat.basesecurity.events.SingleIdentityChosenEvent)6 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)6 Controller (org.olat.core.gui.control.Controller)6 Identity (org.olat.core.id.Identity)6 MultiIdentityChosenEvent (org.olat.basesecurity.events.MultiIdentityChosenEvent)4 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)4 ContextEntry (org.olat.core.id.context.ContextEntry)4 AssertException (org.olat.core.logging.AssertException)4 MailNotificationEditController (org.olat.core.util.mail.MailNotificationEditController)4 MailTemplate (org.olat.core.util.mail.MailTemplate)4 HashMap (java.util.HashMap)2