Search in sources :

Example 36 with Controller

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

the class MembersManagementMainController method selectMenuItem.

private Controller selectMenuItem(UserRequest ureq, String cmd) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(cmd, 0l);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller selectedCtrl = null;
    if (CMD_MEMBERS.equals(cmd)) {
        if (entryAdmin || memberManagementRight) {
            if (membersOverviewCtrl == null) {
                membersOverviewCtrl = new MembersOverviewController(ureq, bwControl, toolbarPanel, repoEntry, coachCourseEnv);
                listenTo(membersOverviewCtrl);
            } else if (membersDirty) {
                membersOverviewCtrl.reloadMembers();
            }
            mainVC.put("content", membersOverviewCtrl.getInitialComponent());
            selectedCtrl = membersOverviewCtrl;
        }
    } else if (CMD_GROUPS.equals(cmd)) {
        if (entryAdmin || memberManagementRight || groupManagementRight) {
            if (groupsCtrl == null) {
                groupsCtrl = new CourseBusinessGroupListController(ureq, bwControl, repoEntry, entryAdmin || groupManagementRight, coachCourseEnv.isCourseReadOnly());
                listenTo(groupsCtrl);
            }
            groupsCtrl.reloadModel();
            mainVC.put("content", groupsCtrl.getInitialComponent());
            selectedCtrl = groupsCtrl;
        }
    } else if (CMD_BOOKING.equals(cmd)) {
        if (acModule.isEnabled() && (entryAdmin || memberManagementRight)) {
            if (ordersController == null) {
                ordersController = new OrdersAdminController(ureq, bwControl, toolbarPanel, repoEntry.getOlatResource());
                listenTo(ordersController);
            }
            mainVC.put("content", ordersController.getInitialComponent());
            selectedCtrl = ordersController;
        }
    } else if (CMD_RIGHTS.equals(cmd)) {
        if (entryAdmin) {
            if (rightsController == null) {
                rightsController = new GroupsAndRightsController(ureq, bwControl, repoEntry, coachCourseEnv.isCourseReadOnly());
                listenTo(rightsController);
            }
            mainVC.put("content", rightsController.getInitialComponent());
            selectedCtrl = rightsController;
        }
    }
    TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menuTree.getTreeModel().getRootNode());
    if (selTreeNode != null && !selTreeNode.getIdent().equals(menuTree.getSelectedNodeId())) {
        menuTree.setSelectedNodeId(selTreeNode.getIdent());
    }
    return selectedCtrl;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) WindowControl(org.olat.core.gui.control.WindowControl) GroupsAndRightsController(org.olat.course.groupsandrights.GroupsAndRightsController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController) OrdersAdminController(org.olat.resource.accesscontrol.ui.OrdersAdminController)

Example 37 with Controller

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

the class AssessmentToolController method doSelectUsersView.

private Controller doSelectUsersView(UserRequest ureq, String resName, AssessedIdentityListState state) {
    if (currentCtl != null) {
        stackPanel.popController(currentCtl);
    }
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(resName, 0l);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);
    Controller treeCtrl = element.createIdentityList(ureq, bwControl, stackPanel, testEntry, assessmentCallback);
    listenTo(treeCtrl);
    stackPanel.pushController(translate("users"), treeCtrl);
    currentCtl = treeCtrl;
    if (treeCtrl instanceof Activateable2) {
        ((Activateable2) treeCtrl).activate(ureq, null, state);
    }
    return currentCtl;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) Controller(org.olat.core.gui.control.Controller) MainLayoutBasicController(org.olat.core.gui.control.controller.MainLayoutBasicController)

Example 38 with Controller

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

the class ParticipantLectureBlocksController method doPrint.

private void doPrint(UserRequest ureq) {
    ControllerCreator printControllerCreator = (lureq, lwControl) -> {
        lwControl.getWindowBackOffice().getChiefController().addBodyCssClass("o_lectures_print");
        Controller printCtrl = new ParticipantLectureBlocksController(lureq, lwControl, entry, assessedIdentity, false, false);
        listenTo(printCtrl);
        return printCtrl;
    };
    ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createPrintPopupLayout(printControllerCreator);
    openInNewBrowserWindow(ureq, layoutCtrlr);
}
Also used : FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement) RepositoryService(org.olat.repository.RepositoryService) Date(java.util.Date) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) LectureBlockAuditLog(org.olat.modules.lecture.LectureBlockAuditLog) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) Autowired(org.springframework.beans.factory.annotation.Autowired) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Map(java.util.Map) SortKey(org.olat.core.commons.persistence.SortKey) ContactList(org.olat.core.util.mail.ContactList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) LectureBlock(org.olat.modules.lecture.LectureBlock) ParticipantCols(org.olat.modules.lecture.ui.ParticipantLectureBlocksDataModel.ParticipantCols) WindowControl(org.olat.core.gui.control.WindowControl) Component(org.olat.core.gui.components.Component) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) LectureService(org.olat.modules.lecture.LectureService) List(java.util.List) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) Identity(org.olat.core.id.Identity) ContactFormController(org.olat.modules.co.ContactFormController) LecturesCompulsoryRenderer(org.olat.modules.lecture.ui.component.LecturesCompulsoryRenderer) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) LectureBlockAndRollCall(org.olat.modules.lecture.model.LectureBlockAndRollCall) Action(org.olat.modules.lecture.LectureBlockAuditLog.Action) HashMap(java.util.HashMap) RepositoryEntry(org.olat.repository.RepositoryEntry) FormItem(org.olat.core.gui.components.form.flexible.FormItem) ArrayList(java.util.ArrayList) Event(org.olat.core.gui.control.Event) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) CalendarUtils(org.olat.commons.calendar.CalendarUtils) Calendar(java.util.Calendar) FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer) GroupRoles(org.olat.basesecurity.GroupRoles) DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) StringHelper(org.olat.core.util.StringHelper) LectureBlockRollCall(org.olat.modules.lecture.LectureBlockRollCall) LectureBlockRollCallStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockRollCallStatusCellRenderer) FlexiTableDataModelFactory(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory) LectureBlockStatus(org.olat.modules.lecture.LectureBlockStatus) ContactMessage(org.olat.core.util.mail.ContactMessage) Formatter(org.olat.core.util.Formatter) LectureModule(org.olat.modules.lecture.LectureModule) Link(org.olat.core.gui.components.link.Link) Controller(org.olat.core.gui.control.Controller) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserManager(org.olat.user.UserManager) BaseFullWebappPopupLayoutFactory(org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayoutFactory) NewControllerFactory(org.olat.NewControllerFactory) DB(org.olat.core.commons.persistence.DB) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) UserRequest(org.olat.core.gui.UserRequest) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) Controller(org.olat.core.gui.control.Controller) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator)

Example 39 with Controller

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

the class LecturesSearchController method doSearch.

private void doSearch(UserRequest ureq) {
    LectureStatisticsSearchParameters params = searchForm.getSearchParameters();
    List<UserPropertyHandler> userPropertyHandlers = searchForm.getUserPropertyHandlers();
    List<LectureBlockIdentityStatistics> statistics = lectureService.getLecturesStatistics(params, userPropertyHandlers, getIdentity(), admin);
    Set<Long> identities = statistics.stream().map(LectureBlockIdentityStatistics::getIdentityKey).collect(Collectors.toSet());
    Controller ctrl;
    if (identities.size() <= 1) {
        listCtrl = new LecturesListController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER, true, true);
        listenTo(listCtrl);
        ctrl = listCtrl;
    } else {
        multipleUsersCtrl = new LecturesListSegmentController(ureq, getWindowControl(), statistics, userPropertyHandlers, LecturesSearchFormController.PROPS_IDENTIFIER);
        listenTo(multipleUsersCtrl);
        ctrl = multipleUsersCtrl;
    }
    stackPanel.popUpToRootController(ureq);
    stackPanel.pushController(translate("results"), ctrl);
}
Also used : LectureStatisticsSearchParameters(org.olat.modules.lecture.model.LectureStatisticsSearchParameters) LectureBlockIdentityStatistics(org.olat.modules.lecture.model.LectureBlockIdentityStatistics) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) LectureRepositoryAdminController(org.olat.modules.lecture.ui.LectureRepositoryAdminController) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Example 40 with Controller

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

the class WikiMainController method updatePageContext.

/**
 * update depended velocity contexts and componetens with latest globally
 * used page
 */
private void updatePageContext(UserRequest ureq, WikiPage page) {
    if (page.getPageName().equals(WikiPage.WIKI_ERROR)) {
        wikiArticleComp.setWikiContent(translate(page.getContent()));
    } else {
        wikiArticleComp.setWikiContent(page.getContent());
    }
    wikiEditForm.setPage(page);
    diffs.clear();
    content.contextPut("page", page);
    articleContent.contextPut("page", page);
    discussionContent.contextPut("page", page);
    editContent.remove(wikiVersionDisplayComp);
    editContent.contextPut("page", page);
    versioningContent.remove(wikiVersionDisplayComp);
    versioningContent.contextPut("page", page);
    boolean userIsPageCreator = getIdentity().getKey().equals(page.getInitalAuthor());
    if (userIsPageCreator) {
        String subPath = page.getPageName();
        String businessPath = getWindowControl().getBusinessControl().getAsString();
        businessPath += "[page=" + subPath + ":0]";
        OLATResourceable wikiRes = OresHelper.createOLATResourceableInstance(WikiArtefact.ARTEFACT_TYPE, ores.getResourceableId());
        if (portfolioModule.isEnabled()) {
            MediaCollectorComponent collectorCmp = new MediaCollectorComponent("portfolio-link", getWindowControl(), page, wikiMediaHandler, businessPath);
            navigationContent.put("portfolio-link", collectorCmp);
        } else {
            Controller ePFCollCtrl = EPUIFactory.createArtefactCollectWizzardController(ureq, getWindowControl(), wikiRes, businessPath);
            if (ePFCollCtrl != null) {
                navigationContent.put("portfolio-link", ePFCollCtrl.getInitialComponent());
            }
        }
    } else {
        clearPortfolioLink();
    }
    OLATResourceable pageRes = OresHelper.createOLATResourceableInstanceWithoutCheck("path=" + page.getPageName(), 0l);
    addToHistory(ureq, pageRes, null);
}
Also used : MediaCollectorComponent(org.olat.modules.portfolio.ui.component.MediaCollectorComponent) OLATResourceable(org.olat.core.id.OLATResourceable) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) DialogBoxController(org.olat.core.gui.control.generic.modal.DialogBoxController) BasicController(org.olat.core.gui.control.controller.BasicController) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) CloneableController(org.olat.core.gui.control.generic.clone.CloneableController) ContextualSubscriptionController(org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController) ForumController(org.olat.modules.fo.ui.ForumController) Controller(org.olat.core.gui.control.Controller) TableController(org.olat.core.gui.components.table.TableController)

Aggregations

Controller (org.olat.core.gui.control.Controller)372 BasicController (org.olat.core.gui.control.controller.BasicController)114 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)82 NodeEditController (org.olat.course.editor.NodeEditController)82 WindowControl (org.olat.core.gui.control.WindowControl)78 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)74 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)62 RepositoryEntry (org.olat.repository.RepositoryEntry)60 Translator (org.olat.core.gui.translator.Translator)54 UserRequest (org.olat.core.gui.UserRequest)52 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)50 OLATResourceable (org.olat.core.id.OLATResourceable)46 ArrayList (java.util.ArrayList)40 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)40 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)36 Component (org.olat.core.gui.components.Component)34 Roles (org.olat.core.id.Roles)34 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)32 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)30 ContextEntry (org.olat.core.id.context.ContextEntry)30