use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class QTIEditorMainController method doImportTable.
private void doImportTable(UserRequest ureq) {
removeAsListenerAndDispose(importTableWizard);
final ItemsPackage importPackage = new ItemsPackage();
final ImportOptions options = new ImportOptions();
options.setShuffle(!qtiPackage.getQTIDocument().isSurvey());
Step start = new QImport_1_InputStep(ureq, importPackage, options, null);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
runContext.put("importPackage", importPackage);
return StepsMainRunController.DONE_MODIFIED;
}
};
importTableWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("tools.import.table"), "o_mi_table_import_wizard");
listenTo(importTableWizard);
getWindowControl().pushAsModalDialog(importTableWizard.getInitialComponent());
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class GoToMeetingController method doJoin.
private void doJoin(UserRequest ureq) {
boolean join = false;
GoToError error = new GoToError();
if (registrant == null) {
registrant = meetingMgr.registerTraining(meeting, getIdentity(), error);
}
if (registrant != null) {
String joinUrl = registrant.getJoinUrl();
if (joinUrl != null) {
RedirectMediaResource redirect = new RedirectMediaResource(joinUrl);
ureq.getDispatchResult().setResultingMediaResource(redirect);
join = true;
}
}
if (!join) {
final String errorMessage;
if (error.hasError()) {
if (error.getError() != null) {
errorMessage = translate(error.getError().i18nKey());
} else {
errorMessage = translate("error.code.unkown");
}
} else {
errorMessage = translate("error.code.unkown");
}
ControllerCreator creator = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// Wrap in column layout, popup window needs a layout controller
String title = "";
String text = errorMessage;
Controller ctr = MessageUIFactory.createErrorMessage(lureq, lwControl, title, text);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
openInNewBrowserWindow(ureq, creator);
}
updateButtons();
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class IQManager method createLockedMessageController.
private GenericMainController createLockedMessageController(UserRequest ureq, WindowControl wControl, String fullName) {
// wrap simple message into mainLayout
GenericMainController glc = new GenericMainController(ureq, wControl) {
@Override
public void init(UserRequest uureq) {
Panel empty = new Panel("empty");
setTranslator(Util.createPackageTranslator(this.getClass(), uureq.getLocale()));
Controller contentCtr = MessageUIFactory.createInfoMessage(uureq, getWindowControl(), translate("status.currently.locked.title"), translate("status.currently.locked", fullName));
// auto dispose later
listenTo(contentCtr);
Component resComp = contentCtr.getInitialComponent();
LayoutMain3ColsController columnLayoutCtr = new LayoutMain3ColsController(uureq, getWindowControl(), empty, resComp, /*do not save no prefs*/
null);
// auto dispose later
listenTo(columnLayoutCtr);
putInitialPanel(columnLayoutCtr.getInitialComponent());
}
@Override
protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest uureq) {
// no menutree means no menu events.
return null;
}
};
glc.init(ureq);
return glc;
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class QuickstartPortletRunController method event.
public void event(UserRequest ureq, Component source, Event event) {
if (source == quickstartVC) {
String cmd = event.getCommand();
String businessPath = null;
if (cmd.equals("cmd.repo.course")) {
businessPath = "[MyCoursesSite:0]";
} else if (cmd.equals("cmd.repo.catalog")) {
businessPath = "[MyCoursesSite:0][Catalog:0]";
} else if (cmd.equals("cmd.settings")) {
businessPath = "[HomeSite:" + ureq.getIdentity().getKey() + "][mysettings:0]";
} else if (cmd.equals("cmd.buddygroup.new")) {
businessPath = "[GroupsSite:0]";
}
if (StringHelper.containsNonWhitespace(businessPath)) {
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
}
} else if (source == helpLink) {
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
return CourseFactory.createHelpCourseLaunchController(lureq, lwControl);
}
};
// wrap the content controller into a full header layout
ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
// open in new browser window
PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
pbw.open(ureq);
//
}
}
use of org.olat.core.gui.UserRequest in project OpenOLAT by OpenOLAT.
the class OlatFooterController method doOpenImpressum.
protected void doOpenImpressum(UserRequest ureq) {
ControllerCreator impressumControllerCreator = new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
return new ImpressumMainController(lureq, lwControl);
}
};
PopupBrowserWindow popupBrowserWindow;
if (ureq.getUserSession().isAuthenticated()) {
popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, impressumControllerCreator);
} else {
popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewUnauthenticatedPopupWindowFor(ureq, impressumControllerCreator);
}
popupBrowserWindow.open(ureq);
}
Aggregations