use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class BinderRuntimeController method doAssessmentTool.
private Activateable2 doAssessmentTool(UserRequest ureq) {
OLATResourceable ores = OresHelper.createOLATResourceableType("TestStatistics");
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl swControl = addToHistory(ureq, ores, null);
if (reSecurity.isEntryAdmin() || reSecurity.isCourseCoach() || reSecurity.isGroupCoach()) {
AssessmentToolSecurityCallback secCallback = new AssessmentToolSecurityCallback(reSecurity.isEntryAdmin(), reSecurity.isEntryAdmin(), reSecurity.isCourseCoach(), reSecurity.isGroupCoach(), null);
AssessableResource el = getAssessableElement();
AssessmentToolController ctrl = new AssessmentToolController(ureq, swControl, toolbarPanel, getRepositoryEntry(), el, secCallback);
listenTo(ctrl);
assessmentToolCtrl = pushController(ureq, "Statistics", ctrl);
currentToolCtr = assessmentToolCtrl;
setActiveTool(assessmentLink);
enableRuntimeNavBar(false);
return assessmentToolCtrl;
}
return null;
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class DeletedBinderController method doOpenBinder.
@Override
protected BinderController doOpenBinder(UserRequest ureq, Binder binder) {
if (binder == null) {
showWarning("warning.portfolio.not.found");
return null;
} else {
removeAsListenerAndDispose(binderCtrl);
OLATResourceable binderOres = OresHelper.createOLATResourceableInstance("Binder", binder.getKey());
WindowControl swControl = addToHistory(ureq, binderOres, null);
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForDeletedBinder();
BinderConfiguration config = BinderConfiguration.createConfig(binder);
binderCtrl = new BinderController(ureq, swControl, stackPanel, secCallback, binder, config);
listenTo(binderCtrl);
stackPanel.pushController(binder.getTitle(), binderCtrl);
return binderCtrl;
}
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class TableOfContentController method doOpenPage.
private PageRunController doOpenPage(UserRequest ureq, Page page) {
removeAsListenerAndDispose(pageCtrl);
OLATResourceable pageOres = OresHelper.createOLATResourceableInstance("Entry", page.getKey());
WindowControl swControl = addToHistory(ureq, pageOres, null);
Page reloadedPage = portfolioService.getPageByKey(page.getKey());
boolean openInEditMode = (secCallback.canEditPage(reloadedPage) && (reloadedPage.getPageStatus() == null || reloadedPage.getPageStatus() == PageStatus.draft || reloadedPage.getPageStatus() == PageStatus.inRevision));
pageCtrl = new PageRunController(ureq, swControl, stackPanel, secCallback, reloadedPage, openInEditMode);
listenTo(pageCtrl);
stackPanel.pushController(page.getTitle(), pageCtrl);
return pageCtrl;
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class BinderUserInformationsDAO method updateBinderUserInformations.
/**
* Update (or create if not exists) the course informations for a user. To creation
* of the user infos is made with doInSync.
*
* @param binder The binder
* @param identity The identity
*/
public void updateBinderUserInformations(final Binder binder, final Identity identity) {
int updatedRows = lowLevelUpdate(binder, identity);
// to make it quick
dbInstance.commit();
if (updatedRows == 0) {
OLATResourceable lockRes = OresHelper.createOLATResourceableInstance("BinderLaunchDate::Identity", identity.getKey());
CoordinatorManager.getInstance().getCoordinator().getSyncer().doInSync(lockRes, new SyncerExecutor() {
@Override
public void execute() {
try {
int retryUpdatedRows = lowLevelUpdate(binder, identity);
if (retryUpdatedRows == 0) {
createAndPersistUserInfos(binder, identity);
}
} catch (Exception e) {
log.error("Cannot update binder informations for: " + identity + " from " + identity, e);
}
}
});
}
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class PortfolioSite method createController.
@Override
protected Controller createController(UserRequest ureq, WindowControl wControl, SiteConfiguration config) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance(PortfolioSite.class, 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ureq, ores, new StateSite(this), wControl, true);
PortfolioPersonalToolController mainController = new PortfolioPersonalToolController(ureq, bwControl);
return mainController;
}
Aggregations