Search in sources :

Example 11 with OLATResourceable

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");
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) SignOnOffEvent(org.olat.core.util.SignOnOffEvent) SessionInfo(org.olat.core.util.SessionInfo) Identity(org.olat.core.id.Identity) IdentityEnvironment(org.olat.core.id.IdentityEnvironment) AssertException(org.olat.core.logging.AssertException)

Example 12 with OLATResourceable

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());
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl)

Example 13 with OLATResourceable

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());
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl)

Example 14 with OLATResourceable

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;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) Identity(org.olat.core.id.Identity) WindowControl(org.olat.core.gui.control.WindowControl)

Example 15 with OLATResourceable

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());
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable)

Aggregations

OLATResourceable (org.olat.core.id.OLATResourceable)924 WindowControl (org.olat.core.gui.control.WindowControl)304 Test (org.junit.Test)158 Identity (org.olat.core.id.Identity)154 RepositoryEntry (org.olat.repository.RepositoryEntry)130 ContextEntry (org.olat.core.id.context.ContextEntry)82 ArrayList (java.util.ArrayList)68 OLATResource (org.olat.resource.OLATResource)60 Controller (org.olat.core.gui.control.Controller)48 Date (java.util.Date)46 AssertException (org.olat.core.logging.AssertException)32 StateSite (org.olat.core.id.context.StateSite)30 SyncerExecutor (org.olat.core.util.coordinate.SyncerExecutor)30 ICourse (org.olat.course.ICourse)30 CourseNode (org.olat.course.nodes.CourseNode)28 DBCheckbox (org.olat.course.nodes.cl.model.DBCheckbox)28 BusinessControl (org.olat.core.id.context.BusinessControl)24 BusinessGroup (org.olat.group.BusinessGroup)24 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)22 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)22