use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class UserSessionManager method internSignOffAndClear.
private void internSignOffAndClear(UserSession usess) {
boolean isDebug = log.isDebug();
if (isDebug)
log.debug("signOffAndClear() START");
signOffAndClearWithout(usess);
// handle safely
try {
if (usess.isAuthenticated()) {
SessionInfo sessionInfo = usess.getSessionInfo();
IdentityEnvironment identityEnvironment = usess.getIdentityEnvironment();
Identity identity = identityEnvironment.getIdentity();
log.audit("Logged off: " + sessionInfo);
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new SignOnOffEvent(identity, false), ORES_USERSESSION);
if (isDebug)
log.debug("signOffAndClear() deregistering usersession from eventbus, id=" + sessionInfo);
// fxdiff FXOLAT-231: event on GUI Preferences extern changes
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Preferences.class, identity.getKey());
CoordinatorManager.getInstance().getCoordinator().getEventBus().deregisterFor(usess, ores);
}
} catch (Exception e) {
log.error("exception in signOffAndClear: while sending signonoffevent!", e);
}
// clear all instance variables, set authenticated to false
usess.init();
if (isDebug)
log.debug("signOffAndClear() END");
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class CertificatesAdminController method doOpenCertificatesList.
private void doOpenCertificatesList(UserRequest ureq) {
if (certificatesCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Certificates", 0l);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
certificatesCtrl = new CertificatesListAdminController(ureq, bwControl);
listenTo(certificatesCtrl);
}
mainVC.put("segmentCmp", certificatesCtrl.getInitialComponent());
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class CertificatesAdminController method doOpenSettings.
private void doOpenSettings(UserRequest ureq) {
if (settingsCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Certificates", 0l);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
settingsCtrl = new CertificatesSettingsAdminController(ureq, bwControl);
listenTo(settingsCtrl);
}
mainVC.put("segmentCmp", settingsCtrl.getInitialComponent());
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class IdentityListCourseNodeController method doSelect.
private Controller doSelect(UserRequest ureq, AssessedIdentityElementRow row) {
removeAsListenerAndDispose(currentIdentityCtrl);
Identity assessedIdentity = securityManager.loadIdentityByKey(row.getIdentityKey());
String fullName = userManager.getUserDisplayName(assessedIdentity);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Identity", assessedIdentity.getKey());
WindowControl bwControl = addToHistory(ureq, ores, null);
if (courseNode.getParent() == null) {
currentIdentityCtrl = new AssessmentIdentityCourseController(ureq, bwControl, stackPanel, courseEntry, coachCourseEnv, assessedIdentity);
} else {
currentIdentityCtrl = new AssessmentIdentityCourseNodeController(ureq, getWindowControl(), stackPanel, courseEntry, courseNode, coachCourseEnv, assessedIdentity, true);
}
listenTo(currentIdentityCtrl);
stackPanel.pushController(fullName, currentIdentityCtrl);
previousLink = LinkFactory.createToolLink("previouselement", "", this, "o_icon_previous_toolbar");
previousLink.setTitle(translate("command.previous"));
stackPanel.addTool(previousLink, Align.rightEdge, false, "o_tool_previous");
nextLink = LinkFactory.createToolLink("nextelement", "", this, "o_icon_next_toolbar");
nextLink.setTitle(translate("command.next"));
stackPanel.addTool(nextLink, Align.rightEdge, false, "o_tool_next");
return currentIdentityCtrl;
}
use of org.olat.core.id.OLATResourceable in project OpenOLAT by OpenOLAT.
the class AssessmentModeGuardController method launchAssessmentMode.
/**
* Remove the list of assessment modes and lock the chief controller.
*
* @param ureq
* @param mode
*/
private void launchAssessmentMode(UserRequest ureq, TransientAssessmentMode mode) {
cmc.deactivate();
ureq.getUserSession().setAssessmentModes(null);
OLATResourceable resource = mode.getResource();
ureq.getUserSession().setLockResource(resource, mode);
getWindowControl().getWindowBackOffice().getChiefController().lockResource(resource);
fireEvent(ureq, new ChooseAssessmentModeEvent(mode));
String businessPath = "[RepositoryEntry:" + mode.getRepositoryEntryKey() + "]";
if (StringHelper.containsNonWhitespace(mode.getStartElementKey())) {
businessPath += "[CourseNode:" + mode.getStartElementKey() + "]";
}
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
}
Aggregations