use of org.olat.core.gui.control.generic.layout.GenericMainController 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.control.generic.layout.GenericMainController in project OpenOLAT by OpenOLAT.
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.layout.GenericMainController in project OpenOLAT by OpenOLAT.
the class IQManager method createIQDisplayController.
/**
* IMS QTI Display Controller used for IMS course node run view, or for the direct launching from learning resources.
*
* concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure)
*
* @param res
* @param resolver
* @param type
* @param secCallback
* @param ureq
* @param wControl
* @return
*/
public MainLayoutController createIQDisplayController(OLATResourceable res, Resolver resolver, String type, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl) {
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(res, OlatResourceableType.iq));
// -- 99% of cases -- 2) qti is ready to be run as test/survey
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)) {
LockResult lockEntry = CoordinatorManager.getInstance().getCoordinator().getLocker().aquirePersistentLock(res, ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockEntry.getOwner());
GenericMainController glc = createLockedMessageController(ureq, wControl, fullName);
return glc;
} else {
Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl);
// fxdiff BAKS-7 Resume function
OLATResourceableListeningWrapperController dwc = new OLATResourceableListeningWrapperController(ureq, wControl, res, controller, null, ureq.getIdentity());
return dwc;
}
}
use of org.olat.core.gui.control.generic.layout.GenericMainController 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.layout.GenericMainController in project openolat by klemens.
the class IQManager method createIQDisplayController.
/**
* IMS QTI Display Controller used for IMS course node run view, or for the direct launching from learning resources.
*
* concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure)
*
* @param res
* @param resolver
* @param type
* @param secCallback
* @param ureq
* @param wControl
* @return
*/
public MainLayoutController createIQDisplayController(OLATResourceable res, Resolver resolver, String type, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl) {
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(res, OlatResourceableType.iq));
// -- 99% of cases -- 2) qti is ready to be run as test/survey
if (CoordinatorManager.getInstance().getCoordinator().getLocker().isLocked(res, null)) {
LockResult lockEntry = CoordinatorManager.getInstance().getCoordinator().getLocker().aquirePersistentLock(res, ureq.getIdentity(), null);
String fullName = userManager.getUserDisplayName(lockEntry.getOwner());
GenericMainController glc = createLockedMessageController(ureq, wControl, fullName);
return glc;
} else {
Controller controller = new IQDisplayController(resolver, type, secCallback, ureq, wControl);
// fxdiff BAKS-7 Resume function
OLATResourceableListeningWrapperController dwc = new OLATResourceableListeningWrapperController(ureq, wControl, res, controller, null, ureq.getIdentity());
return dwc;
}
}
Aggregations