Search in sources :

Example 16 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class ExportBinderAsCPResource method exportPage.

private void exportPage(Page page, ZipOutputStream zout) throws IOException {
    WindowControl mockwControl = new WindowControlMocker();
    BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
    PageMetadataController metadatCtrl = new PageMetadataController(ureq, mockwControl, secCallback, page);
    PageController pageCtrl = new PageController(ureq, mockwControl, new PortfolioPageProvider(page), ExtendedMediaRenderingHints.toPrint());
    pageCtrl.loadElements(ureq);
    CommentAndRatingSecurityCallback commentSecCallback = new ReadOnlyCommentsSecurityCallback();
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, page.getKey());
    UserCommentsController commentsCtrl = new UserCommentsController(ureq, mockwControl, ores, null, commentSecCallback);
    Component metadata = metadatCtrl.getInitialComponent();
    Component component = pageCtrl.getInitialComponent();
    Component comments = commentsCtrl.getNumOfComments() > 0 ? commentsCtrl.getInitialComponent() : null;
    String html = createResultHTML(metadata, component, comments, "o_page_export");
    html = exportMedia(html, zout);
    convertToZipEntry(zout, pageFilename(page), html);
    pageCtrl.dispose();
    metadatCtrl.dispose();
}
Also used : CommentAndRatingSecurityCallback(org.olat.core.commons.services.commentAndRating.CommentAndRatingSecurityCallback) PageController(org.olat.modules.portfolio.ui.editor.PageController) OLATResourceable(org.olat.core.id.OLATResourceable) ReadOnlyCommentsSecurityCallback(org.olat.modules.portfolio.ui.model.ReadOnlyCommentsSecurityCallback) UserCommentsController(org.olat.core.commons.services.commentAndRating.ui.UserCommentsController) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) Component(org.olat.core.gui.components.Component) WindowControlMocker(org.olat.core.gui.util.WindowControlMocker) PageMetadataController(org.olat.modules.portfolio.ui.PageMetadataController)

Example 17 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class TrashController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == pagesLink) {
                doOpenPages(ureq);
            } else if (clickedLink == bindersLink) {
                doOpenBinders(ureq);
            }
        }
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent)

Example 18 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class ViteroAdminController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == accountLink) {
                doOpenAccountSettings(ureq);
            } else if (clickedLink == bookingsLink) {
                doOpenBookings(ureq);
            }
        }
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent)

Example 19 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class UserOrderController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == segmentView) {
        if (event instanceof SegmentViewEvent) {
            SegmentViewEvent sve = (SegmentViewEvent) event;
            String segmentCName = sve.getComponentName();
            Component clickedLink = mainVC.getComponent(segmentCName);
            if (clickedLink == ordersLink) {
                doOpenOrders(ureq);
            } else if (clickedLink == advanceOrdersLink) {
                doOpenAdvanceOrders(ureq);
            }
        }
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent)

Example 20 with Component

use of org.olat.core.gui.components.Component in project OpenOLAT by OpenOLAT.

the class MembersOverviewController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (event instanceof SegmentViewEvent) {
        SegmentViewEvent sve = (SegmentViewEvent) event;
        String segmentCName = sve.getComponentName();
        Component clickedLink = mainVC.getComponent(segmentCName);
        if (clickedLink == allMembersLink) {
            selectedCtrl = updateAllMembers(ureq);
        } else if (clickedLink == ownersLink) {
            selectedCtrl = updateOwners(ureq);
        } else if (clickedLink == tutorsLink) {
            selectedCtrl = updateTutors(ureq);
        } else if (clickedLink == participantsLink) {
            selectedCtrl = updateParticipants(ureq);
        } else if (clickedLink == waitingListLink) {
            selectedCtrl = updateWaitingList(ureq);
        } else if (clickedLink == searchLink) {
            updateSearch(ureq);
            selectedCtrl = null;
        }
    } else if (source == addMemberLink) {
        doChooseMembers(ureq);
    } else if (source == importMemberLink) {
        doImportMembers(ureq);
    } else if (source == dedupLink) {
        doDedupMembers(ureq);
    } else if (source == overrideLink) {
        doOverrideManagedResource(ureq);
    } else if (source == unOverrideLink) {
        doUnOverrideManagedResource(ureq);
    }
}
Also used : SegmentViewEvent(org.olat.core.gui.components.segmentedview.SegmentViewEvent) Component(org.olat.core.gui.components.Component) SegmentViewComponent(org.olat.core.gui.components.segmentedview.SegmentViewComponent)

Aggregations

Component (org.olat.core.gui.components.Component)300 SegmentViewComponent (org.olat.core.gui.components.segmentedview.SegmentViewComponent)90 SegmentViewEvent (org.olat.core.gui.components.segmentedview.SegmentViewEvent)90 ArrayList (java.util.ArrayList)36 Controller (org.olat.core.gui.control.Controller)28 Link (org.olat.core.gui.components.link.Link)22 BasicController (org.olat.core.gui.control.controller.BasicController)22 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)22 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)18 Panel (org.olat.core.gui.components.panel.Panel)12 HighScoreRunController (org.olat.course.highscore.ui.HighScoreRunController)12 Date (java.util.Date)10 UserRequest (org.olat.core.gui.UserRequest)10 ComponentRenderer (org.olat.core.gui.components.ComponentRenderer)10 TreeNode (org.olat.core.gui.components.tree.TreeNode)10 RenderResult (org.olat.core.gui.render.RenderResult)10 StringOutput (org.olat.core.gui.render.StringOutput)10 Translator (org.olat.core.gui.translator.Translator)10 AbstractComponent (org.olat.core.gui.components.AbstractComponent)8 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)8