use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementArtefactHandler method createDetailsController.
@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
EfficiencyStatement statement = null;
if (StringHelper.containsNonWhitespace(statementXml)) {
try {
statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
} catch (Exception e) {
log.error("Cannot load efficiency statement from artefact", e);
}
}
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class TURunController method doLaunch.
private void doLaunch(UserRequest ureq) {
boolean iniframe = config.getBooleanSafe(TUConfigForm.CONFIG_IFRAME);
// create the possibility to float
CloneableController controller;
if (iniframe) {
// Do not dispose this controller if the course is closed...
IframeTunnelController ifC = new IframeTunnelController(ureq, getWindowControl(), config);
controller = ifC;
} else {
TunnelController tuC = new TunnelController(ureq, getWindowControl(), config);
controller = tuC;
}
listenTo(controller);
// create clone wrapper layout
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(UserRequest ureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@SuppressWarnings("synthetic-access")
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// wrapp in column layout, popup window needs a layout controller
Controller ctr = contentControllerCreator.createController(lureq, lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), courseEnv));
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
}
};
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), controller, courseNode, "o_tu_icon");
if (ctrl instanceof CloneableController) {
cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
listenTo(cloneC);
main.setContent(cloneC.getInitialComponent());
} else {
throw new AssertException("Controller must be cloneable");
}
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class EfficiencyStatementsPortletRunController method event.
/**
* @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
super.event(ureq, source, event);
if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
if (actionid.equals(CMD_LAUNCH)) {
int rowid = te.getRowId();
final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
// will not be disposed on course run dispose, popus up as new browserwindow
ControllerCreator ctrlCreator = new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
}
};
// 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.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class HomeMainController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
ContextEntry entry = entries.get(0);
String navKey = entry.getOLATResourceable().getResourceableTypeName();
if ("HomeSite".equals(navKey)) {
entries = entries.subList(1, entries.size());
if (entries.size() > 0) {
entry = entries.get(0);
navKey = entry.getOLATResourceable().getResourceableTypeName();
}
}
if (navKey.equals(currentNavKey) && currentCtr instanceof ReusableHomeController) {
if (currentCtr instanceof Activateable2) {
((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
}
} else {
GenericActionExtension gAE = ExtManager.getInstance().getActionExtensioByNavigationKey(HomeMainController.class.getName(), navKey);
if (gAE != null) {
currentNavKey = navKey;
stackPanel.popUpToRootController(ureq);
currentCtr = createController(gAE, ureq);
contentCtr = new LayoutMain3ColsController(ureq, getWindowControl(), currentCtr);
listenTo(contentCtr);
if (entries.size() >= 1) {
entries = entries.subList(1, entries.size());
}
String actionText = gAE.getActionText(getLocale());
stackPanel.rootController(actionText, contentCtr);
if (currentCtr instanceof Activateable2) {
((Activateable2) currentCtr).activate(ureq, entries, entry.getTransientState());
}
}
}
}
use of org.olat.core.commons.fullWebApp.LayoutMain3ColsController in project OpenOLAT by OpenOLAT.
the class GuiDemoPushPopController method event.
public void event(UserRequest ureq, Component source, Event event) {
if (source == pushButton) {
VelocityContainer container = this.createVelocityContainer("guidemo-pushpop");
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, container, null);
listenTo(layoutCtr);
windowStack.push(layoutCtr.getInitialComponent());
container.put("guidemo.window.control.push", pushButton);
container.put("guidemo.window.control.pop", popButton);
container.contextPut("stack", getStackHTMLRepresentation());
getWindowControl().pushToMainArea(container);
} else if (source == popButton) {
if (windowStack.isEmpty()) {
fireEvent(ureq, Event.DONE_EVENT);
} else {
getWindowControl().pop();
windowStack.pop();
}
}
}
Aggregations