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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations