use of org.olat.core.gui.control.generic.messages.MessageController in project openolat by klemens.
the class RepositoyUIFactory method createRepoEntryDisabledDueToSecurityMessageController.
/**
* Create main controller that does nothing but displaying a message that
* this resource is disabled due to security constraints
*
* @param ureq
* @param wControl
* @return
*/
public static GenericMainController createRepoEntryDisabledDueToSecurityMessageController(UserRequest ureq, WindowControl wControl) {
// 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(RepositoryModule.class, uureq.getLocale()));
MessageController contentCtr = MessageUIFactory.createInfoMessage(uureq, getWindowControl(), translate("security.disabled.title"), translate("security.disabled.info"));
// 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.control.generic.messages.MessageController in project openolat by klemens.
the class DisposedCourseRestartController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.components.Component,
* org.olat.core.gui.control.Event)
*/
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == restartLink) {
OLATResourceable ores = OLATResourceManager.getInstance().findResourceable(courseRepositoryEntry.getOlatResource().getResourceableId(), courseRepositoryEntry.getOlatResource().getResourceableTypeName());
if (ores == null) {
// course was deleted!
MessageController msgController = MessageUIFactory.createInfoMessage(ureq, getWindowControl(), translate("course.deleted.title"), translate("course.deleted.text"));
panel.setContent(msgController.getInitialComponent());
} else {
OLATResourceable reOres = OresHelper.clone(courseRepositoryEntry);
DTabs dtabs = getWindowControl().getWindowBackOffice().getWindow().getDTabs();
if (dtabs != null) {
DTab dt = dtabs.getDTab(reOres);
if (dt != null) {
dtabs.removeDTab(ureq, dt);
}
}
List<ContextEntry> entries = null;
List<HistoryPoint> stacks = ureq.getUserSession().getHistoryStack();
for (int i = stacks.size(); i-- > 0; ) {
HistoryPoint point = stacks.get(i);
if (point != null && point.getEntries() != null && point.getEntries().size() > 0) {
ContextEntry entry = point.getEntries().get(0);
if (reOres.equals(entry.getOLATResourceable())) {
entries = point.getEntries();
break;
}
}
}
WindowControl bwControl;
if (entries == null) {
bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(getWindowControl(), reOres);
} else {
BusinessControl bc = BusinessControlFactory.getInstance().createFromContextEntries(entries);
bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
}
NewControllerFactory.getInstance().launch(ureq, bwControl);
dispose();
}
}
}
use of org.olat.core.gui.control.generic.messages.MessageController in project openolat by klemens.
the class ScormRunController method doSetMissingResourcesWarning.
private void doSetMissingResourcesWarning(UserRequest ureq) {
String text = translate("error.cprepoentrymissing.user");
MessageController missingCtrl = MessageUIFactory.createWarnMessage(ureq, getWindowControl(), null, text);
listenTo(missingCtrl);
main.setContent(missingCtrl.getInitialComponent());
}
Aggregations