Search in sources :

Example 56 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class EfficiencyStatementArtefactHandler method createDetailsController.

@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
    EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
    String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
    EfficiencyStatement statement = null;
    if (StringHelper.containsNonWhitespace(statementXml)) {
        try {
            statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
        } catch (Exception e) {
            log.error("Cannot load efficiency statement from artefact", e);
        }
    }
    CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
    return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager)

Example 57 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class TURunController method doLaunch.

private void doLaunch(UserRequest ureq) {
    boolean iniframe = config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME);
    // create the possibility to float
    CloneableController controller;
    if (iniframe) {
        // Do not dispose this controller if the course is closed...
        IframeTunnelController ifC = new IframeTunnelController(ureq, getWindowControl(), config);
        controller = ifC;
    } else {
        TunnelController tuC = new TunnelController(ureq, getWindowControl(), config);
        controller = tuC;
    }
    listenTo(controller);
    // create clone wrapper layout
    CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {

        public ControllerCreator createLayoutControllerCreator(UserRequest ureq, final ControllerCreator contentControllerCreator) {
            return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {

                @SuppressWarnings("synthetic-access")
                public Controller createController(UserRequest lureq, WindowControl lwControl) {
                    // wrapp in column layout, popup window needs a layout controller
                    Controller ctr = contentControllerCreator.createController(lureq, lwControl);
                    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
                    layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), courseEnv));
                    layoutCtr.addDisposableChildController(ctr);
                    return layoutCtr;
                }
            });
        }
    };
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), controller, courseNode, "o_tu_icon");
    if (ctrl instanceof CloneableController) {
        cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
        listenTo(cloneC);
        main.setContent(cloneC.getInitialComponent());
    } else {
        throw new AssertException("Controller must be cloneable");
    }
}
Also used : AssertException(org.olat.core.logging.AssertException) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) WindowControl(org.olat.core.gui.control.WindowControl) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) TunnelController(org.olat.modules.tu.TunnelController) CloneController(org.olat.core.gui.control.generic.clone.CloneController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) CloneController(org.olat.core.gui.control.generic.clone.CloneController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CloneLayoutControllerCreatorCallback(org.olat.core.gui.control.generic.clone.CloneLayoutControllerCreatorCallback) TunnelController(org.olat.modules.tu.TunnelController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) IframeTunnelController(org.olat.modules.tu.IframeTunnelController) UserRequest(org.olat.core.gui.UserRequest)

Example 58 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

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 59 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class HomeMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry entry = entries.get(0);
    String navKey = entry.getOLATResourceable().getResourceableTypeName();
    if ("HomeSite".equals(navKey)) {
        entries = entries.subList(1, entries.size());
        if (entries.size() > 0) {
            entry = entries.get(0);
            navKey = entry.getOLATResourceable().getResourceableTypeName();
        }
    }
    if (navKey.equals(currentNavKey) && currentCtr instanceof ReusableHomeController) {
        if (currentCtr instanceof Activateable2) {
            ((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
        }
    } else {
        GenericActionExtension gAE = ExtManager.getInstance().getActionExtensioByNavigationKey(HomeMainController.class.getName(), navKey);
        if (gAE != null) {
            currentNavKey = navKey;
            stackPanel.popUpToRootController(ureq);
            currentCtr = createController(gAE, ureq);
            contentCtr = new LayoutMain3ColsController(ureq, getWindowControl(), currentCtr);
            listenTo(contentCtr);
            if (entries.size() >= 1) {
                entries = entries.subList(1, entries.size());
            }
            String actionText = gAE.getActionText(getLocale());
            stackPanel.rootController(actionText, contentCtr);
            if (currentCtr instanceof Activateable2) {
                ((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) GenericActionExtension(org.olat.core.extensions.action.GenericActionExtension) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 60 with LayoutMain3ColsController

use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.

the class GuiDemoPushPopController method event.

public void event(UserRequest ureq, Component source, Event event) {
    if (source == pushButton) {
        VelocityContainer container = this.createVelocityContainer("guidemo-pushpop");
        LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, container, null);
        listenTo(layoutCtr);
        windowStack.push(layoutCtr.getInitialComponent());
        container.put("guidemo.window.control.push", pushButton);
        container.put("guidemo.window.control.pop", popButton);
        container.contextPut("stack", getStackHTMLRepresentation());
        getWindowControl().pushToMainArea(container);
    } else if (source == popButton) {
        if (windowStack.isEmpty()) {
            fireEvent(ureq, Event.DONE_EVENT);
        } else {
            getWindowControl().pop();
            windowStack.pop();
        }
    }
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)80 WindowControl (org.olat.core.gui.control.WindowControl)38 Controller (org.olat.core.gui.control.Controller)36 UserRequest (org.olat.core.gui.UserRequest)34 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)28 Panel (org.olat.core.gui.components.panel.Panel)12 BasicController (org.olat.core.gui.control.controller.BasicController)12 RepositoryEntry (org.olat.repository.RepositoryEntry)12 MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)10 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)10 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 ContextEntry (org.olat.core.id.context.ContextEntry)8 AssertException (org.olat.core.logging.AssertException)8 ICourse (org.olat.course.ICourse)8 GlossaryMainController (org.olat.core.commons.modules.glossary.GlossaryMainController)6 Component (org.olat.core.gui.components.Component)6 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)6 CloneController (org.olat.core.gui.control.generic.clone.CloneController)6 CertificateAndEfficiencyStatementController (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController)6