Search in sources :

Example 6 with SinglePageController

use of org.olat.core.commons.modules.singlepage.SinglePageController in project OpenOLAT by OpenOLAT.

the class SubmitDocumentsController method doView.

private void doView(UserRequest ureq, String filename) {
    if (viewDocCtrl != null)
        return;
    viewDocCtrl = new SinglePageController(ureq, getWindowControl(), documentsContainer, filename, false);
    listenTo(viewDocCtrl);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), viewDocCtrl.getInitialComponent(), true, filename);
    listenTo(cmc);
    cmc.activate();
}
Also used : SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 7 with SinglePageController

use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.

the class SPRunController method doInlineIntegration.

private void doInlineIntegration(UserRequest ureq, boolean hasEditRightsTo) {
    boolean allowRelativeLinks = config.getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS);
    // create the possibility to float
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(ICourse.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    DeliveryOptions deliveryOptions = (DeliveryOptions) config.get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS);
    spCtr = new SinglePageController(ureq, getWindowControl(), courseFolderContainer, fileName, allowRelativeLinks, null, ores, deliveryOptions, userCourseEnv.getCourseEnvironment().isPreview());
    spCtr.setAllowDownload(true);
    // only for inline integration: register for controller event to forward a olatcmd to the course,
    // and also to remember latest position in the script
    listenTo(spCtr);
    // enable edit mode if user has the according rights
    if (hasEditRightsTo) {
        spCtr.allowPageEditing();
        // set the link tree model to internal for the HTML editor
        if (linkTreeModel != null) {
            spCtr.setInternalLinkTreeModel(linkTreeModel);
        }
    }
    // create clone wrapper layout
    CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {

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

                public Controller createController(UserRequest lureq, WindowControl lwControl) {
                    // Wrap 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(), userCourseEnv.getCourseEnvironment()));
                    // Controller titledCtrl = TitledWrapperHelper.getWrapper(lureq, lwControl, ctr, courseNode, "o_sp_icon");
                    layoutCtr.addDisposableChildController(ctr);
                    return layoutCtr;
                }
            });
        }
    };
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), spCtr, courseNode, "o_sp_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) OLATResourceable(org.olat.core.id.OLATResourceable) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) WindowControl(org.olat.core.gui.control.WindowControl) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CloneController(org.olat.core.gui.control.generic.clone.CloneController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) 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) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) UserRequest(org.olat.core.gui.UserRequest)

Example 8 with SinglePageController

use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.

the class GTAAvailableTaskController method doPreview.

private void doPreview(UserRequest ureq, String filename) {
    if (filename != null && filename.endsWith(".html")) {
        VFSContainer tasksContainer = gtaManager.getTasksContainer(courseEnv, gtaNode);
        previewCtrl = new SinglePageController(ureq, getWindowControl(), tasksContainer, filename, false);
        listenTo(previewCtrl);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), previewCtrl.getInitialComponent(), true, filename);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Example 9 with SinglePageController

use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.

the class DirectoryController method doDownload.

private void doDownload(UserRequest ureq, File file) {
    if (file.getName().endsWith(".html")) {
        previewCtrl = new SinglePageController(ureq, getWindowControl(), documentsContainer, file.getName(), false);
        listenTo(previewCtrl);
        cmc = new CloseableModalController(getWindowControl(), translate("close"), previewCtrl.getInitialComponent(), true, file.getName());
        listenTo(cmc);
        cmc.activate();
    } else {
        MediaResource mdr = new FileMediaResource(file, true);
        ureq.getDispatchResult().setResultingMediaResource(mdr);
    }
}
Also used : SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) FileMediaResource(org.olat.core.gui.media.FileMediaResource) FileMediaResource(org.olat.core.gui.media.FileMediaResource) MediaResource(org.olat.core.gui.media.MediaResource) ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource)

Example 10 with SinglePageController

use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.

the class DocumentPoolInfoPageController method doViewInfoPage.

private void doViewInfoPage(UserRequest ureq) {
    cleanUp();
    VFSContainer container = docPoolModule.getInfoPageContainer();
    indexCtrl = new SinglePageController(ureq, getWindowControl(), container, "index.html", false);
    listenTo(indexCtrl);
    mainVC.put("index", indexCtrl.getInitialComponent());
}
Also used : SinglePageController(org.olat.core.commons.modules.singlepage.SinglePageController) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Aggregations

SinglePageController (org.olat.core.commons.modules.singlepage.SinglePageController)18 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 VFSContainer (org.olat.core.util.vfs.VFSContainer)8 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 UserRequest (org.olat.core.gui.UserRequest)4 Controller (org.olat.core.gui.control.Controller)4 WindowControl (org.olat.core.gui.control.WindowControl)4 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)4 CloneController (org.olat.core.gui.control.generic.clone.CloneController)4 CloneLayoutControllerCreatorCallback (org.olat.core.gui.control.generic.clone.CloneLayoutControllerCreatorCallback)4 CloneableController (org.olat.core.gui.control.generic.clone.CloneableController)4 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)4 OLATResourceable (org.olat.core.id.OLATResourceable)4 AssertException (org.olat.core.logging.AssertException)4 CustomLinkTreeModel (org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel)2 LayoutMain3ColsPreviewController (org.olat.core.commons.fullWebApp.LayoutMain3ColsPreviewController)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 FileMediaResource (org.olat.core.gui.media.FileMediaResource)2 MediaResource (org.olat.core.gui.media.MediaResource)2