use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class PublishController method doAddAccessRights.
private void doAddAccessRights(UserRequest ureq) {
removeAsListenerAndDispose(addMembersWizard);
Step start = new AddMember_1_ChooseMemberStep(ureq, binder);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
AccessRightsContext rightsContext = (AccessRightsContext) runContext.get("rightsContext");
MailTemplate mailTemplate = (MailTemplate) runContext.get("mailTemplate");
addMembers(rightsContext, mailTemplate);
return StepsMainRunController.DONE_MODIFIED;
}
};
addMembersWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("add.member"), "o_sel_course_member_import_1_wizard");
listenTo(addMembersWizard);
getWindowControl().pushAsModalDialog(addMembersWizard.getInitialComponent());
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class TableOfContentController method doOpenPage.
private PageRunController doOpenPage(UserRequest ureq, Page page) {
removeAsListenerAndDispose(pageCtrl);
OLATResourceable pageOres = OresHelper.createOLATResourceableInstance("Entry", page.getKey());
WindowControl swControl = addToHistory(ureq, pageOres, null);
Page reloadedPage = portfolioService.getPageByKey(page.getKey());
boolean openInEditMode = (secCallback.canEditPage(reloadedPage) && (reloadedPage.getPageStatus() == null || reloadedPage.getPageStatus() == PageStatus.draft || reloadedPage.getPageStatus() == PageStatus.inRevision));
pageCtrl = new PageRunController(ureq, swControl, stackPanel, secCallback, reloadedPage, openInEditMode);
listenTo(pageCtrl);
stackPanel.pushController(page.getTitle(), pageCtrl);
return pageCtrl;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class PortfolioSite method createController.
@Override
protected Controller createController(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(PortfolioSite.class, 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ureq, ores, new StateSite(this), wControl, true);
PortfolioPersonalToolController mainController = new PortfolioPersonalToolController(ureq, bwControl);
return mainController;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class EditorMainController method launchPublishingWizard.
private void launchPublishingWizard(UserRequest ureq, ICourse course, boolean requestOnClose) {
// ignore enter
if (publishStepsController != null)
return;
/*
* start follwoing steps -> cancel wizardf does not touch data
* (M) Mandatory (O) Optional
* - (M)Step 00 -> show selection tree to choose changed nodes to be published
* ...........-> calculate errors & warnings
* ...........(next|finish) available if no errors or nothing to publish
* - (O)Step 00A -> review errors & warnings
* ...........(previous|next|finish) available
* - (O)Step 00B -> review publish changes that will happen
* ...........(previous|next|finish) available
* - (O)Step 01 -> change general access to course
* ...........(previous|finish) available
* - FinishCallback -> apply course nodes change set
* .................-> apply general access changes.
*/
Step start = new PublishStep00(ureq, cetm, course);
/*
* callback executed in case wizard is finished.
*/
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest ureq1, WindowControl wControl1, StepsRunContext runContext) {
// all information to do now is within the runContext saved
boolean hasChanges = false;
PublishProcess publishManager = (PublishProcess) runContext.get("publishProcess");
PublishEvents publishEvents = publishManager.getPublishEvents();
if (runContext.containsKey("validPublish") && ((Boolean) runContext.get("validPublish")).booleanValue()) {
@SuppressWarnings("unchecked") Collection<String> selectedNodeIds = (Collection<String>) runContext.get("publishSetCreatedFor");
hasChanges = (selectedNodeIds != null) && (selectedNodeIds.size() > 0);
if (hasChanges) {
publishManager.applyPublishSet(ureq1.getIdentity(), ureq1.getLocale(), false);
}
}
if (runContext.containsKey("accessAndProperties")) {
CourseAccessAndProperties accessAndProperties = (CourseAccessAndProperties) runContext.get("accessAndProperties");
// fires an EntryChangedEvent for repository entry notifying
// about modification.
publishManager.changeAccessAndProperties(getIdentity(), accessAndProperties);
hasChanges = true;
}
CourseCatalog courseCatalog = (CourseCatalog) runContext.get("categories");
if (courseCatalog != null) {
publishManager.publishToCatalog(courseCatalog.getChoiceValue(), courseCatalog.getCategoryLabels());
}
if (publishEvents.getPostPublishingEvents().size() > 0) {
for (MultiUserEvent event : publishEvents.getPostPublishingEvents()) {
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, ores);
}
}
// signal correct completion and tell if changes were made or not.
return hasChanges ? StepsMainRunController.DONE_MODIFIED : StepsMainRunController.DONE_UNCHANGED;
}
};
publishStepsController = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("publish.wizard.title"), "o_sel_course_publish_wizard");
listenTo(publishStepsController);
publishStepsController.getRunContext().put("requestOnClose", requestOnClose);
getWindowControl().pushAsModalDialog(publishStepsController.getInitialComponent());
}
use of org.olat.core.gui.control.WindowControl 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;
}
Aggregations