use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.
the class CertificateAndEfficiencyStatementController method doOpenHome.
private void doOpenHome(UserRequest ureq) {
List<ContextEntry> ces = new ArrayList<ContextEntry>(1);
ces.add(BusinessControlFactory.getInstance().createContextEntry(statementOwner));
BusinessControl bc = BusinessControlFactory.getInstance().createFromContextEntries(ces);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNodeRunController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == newMapLink) {
RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
Date deadline = courseNode.getDeadline();
if (templateMap != null) {
copyMap = ePFMgr.assignStructuredMapToUser(getIdentity(), templateMap, courseEntry, courseNode.getIdent(), null, deadline);
if (copyMap != null) {
showInfo("map.copied", StringHelper.escapeHtml(templateMap.getTitle()));
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(copyMap));
ThreadLocalUserActivityLogger.log(EPLoggingAction.EPORTFOLIO_TASK_STARTED, getClass());
}
} else if (templateBinder != null) {
if (copyBinder == null) {
copyBinder = portfolioService.assignBinder(getIdentity(), templateBinder, courseEntry, courseNode.getIdent(), deadline);
if (copyBinder != null) {
showInfo("map.copied", StringHelper.escapeHtml(templateBinder.getTitle()));
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(copyBinder));
ThreadLocalUserActivityLogger.log(PortfolioLoggingAction.PORTFOLIO_TASK_STARTED, getClass());
}
} else if (copyBinder != null && copyBinder.getBinderStatus() == BinderStatus.deleted) {
String title = translate("trashed.binder.confirm.title");
String text = translate("trashed.binder.confirm.descr", new String[] { StringHelper.escapeHtml(copyBinder.getTitle()) });
restoreBinderCtrl = activateYesNoDialog(ureq, title, text, restoreBinderCtrl);
restoreBinderCtrl.setUserObject(copyBinder);
return;
}
}
updateUI(ureq);
} else if (source == selectMapLink) {
String resourceUrl;
if (copyMap != null) {
resourceUrl = "[HomeSite:" + getIdentity().getKey() + "][Portfolio:0][EPStructuredMap:" + copyMap.getKey() + "]";
} else if (copyBinder != null) {
resourceUrl = "[HomeSite:" + getIdentity().getKey() + "][PortfolioV2:0][MyBinders:0][Binder:" + copyBinder.getKey() + "]";
} else {
return;
}
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
} else if ("ONCLICK".equals(event.getCommand())) {
String cmd = ureq.getParameter("fcid");
String panelId = ureq.getParameter("panel");
if (StringHelper.containsNonWhitespace(cmd) && StringHelper.containsNonWhitespace(panelId)) {
saveOpenPanel(ureq, panelId, "show".equals(cmd));
}
}
}
use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.
the class CollaborationTools method createWikiController.
/**
* return an controller for the wiki tool
* @param ureq
* @param wControl
* @return
*/
public Controller createWikiController(UserRequest ureq, WindowControl wControl) {
// Check for jumping to certain wiki page
BusinessControl bc = wControl.getBusinessControl();
ContextEntry ce = bc.popLauncherContextEntry();
SubscriptionContext subContext = new SubscriptionContext(ores, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
boolean isResourceOwner = BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(ureq.getIdentity(), Constants.PERMISSION_ACCESS, ores);
WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOlatAdmin, isGuestOnly, true, isResourceOwner, subContext);
if (ce != null) {
// jump to a certain context
OLATResourceable ceOres = ce.getOLATResourceable();
String typeName = ceOres.getResourceableTypeName();
String page = typeName.substring("page=".length());
if (page != null && page.endsWith(":0")) {
page = page.substring(0, page.length() - 2);
}
return WikiManager.getInstance().createWikiMainController(ureq, wControl, ores, callback, page);
} else {
return WikiManager.getInstance().createWikiMainController(ureq, wControl, ores, callback, null);
}
}
use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.
the class NotificationsPortletRunController 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)
*/
public void event(UserRequest ureq, Component source, Event event) {
if (source == showAllLink) {
// activate homes tab in top navigation and active bookmarks menu item
String resourceUrl = "[HomeSite:" + ureq.getIdentity().getKey() + "][notifications:0]";
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
} else if (event == ComponentUtil.VALIDATE_EVENT && needsModelReload) {
// updateTableModel(ureq.getLocale(), ureq.getIdentity());
reloadModel(sortingCriteria);
needsModelReload = false;
}
}
use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.
the class MembersAvatarDisplayRunController method doOpenHomePage.
private void doOpenHomePage(Member member, UserRequest ureq) {
String url = "[HomePage:" + member.getKey() + "]";
BusinessControl bc = BusinessControlFactory.getInstance().createFromString(url);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
Aggregations