Search in sources :

Example 6 with IdentityResourceKey

use of org.olat.modules.coach.model.IdentityResourceKey in project OpenOLAT by OpenOLAT.

the class CourseController method loadModel.

public List<EfficiencyStatementEntry> loadModel() {
    List<EfficiencyStatementEntry> entries = coachingService.getCourse(getIdentity(), course, userPropertyHandlers, getLocale());
    Long resourceKey = course.getOlatResource().getKey();
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(course.getOlatResource());
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(certificate.getIdentityKey(), resourceKey);
        certificateMap.put(key, certificate);
    }
    model.setObjects(entries, certificateMap);
    tableEl.reloadData();
    tableEl.reset();
    return entries;
}
Also used : EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey)

Example 7 with IdentityResourceKey

use of org.olat.modules.coach.model.IdentityResourceKey in project OpenOLAT by OpenOLAT.

the class StudentCoursesController method loadModel.

private List<EfficiencyStatementEntry> loadModel() {
    List<RepositoryEntry> courses = fullAccess ? coachingService.getUserCourses(student) : coachingService.getStudentsCourses(getIdentity(), student);
    List<EfficiencyStatementEntry> statements = coachingService.getEfficencyStatements(student, courses, userPropertyHandlers, getLocale());
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(student);
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(student.getKey(), certificate.getOlatResourceKey());
        certificateMap.put(key, certificate);
    }
    ConcurrentMap<IdentityRepositoryEntryKey, LectureBlockStatistics> lecturesMap = new ConcurrentHashMap<>();
    if (lectureModule.isEnabled()) {
        List<LectureBlockStatistics> lectureStats = lectureService.getParticipantLecturesStatistics(student);
        for (LectureBlockStatistics lectureStat : lectureStats) {
            IdentityRepositoryEntryKey key = new IdentityRepositoryEntryKey(student.getKey(), lectureStat.getRepoKey());
            lecturesMap.put(key, lectureStat);
        }
    }
    model.setObjects(statements, certificateMap, lecturesMap);
    tableEl.reset();
    tableEl.reloadData();
    return statements;
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) LectureBlockStatistics(org.olat.modules.lecture.model.LectureBlockStatistics) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey) IdentityRepositoryEntryKey(org.olat.modules.coach.model.IdentityRepositoryEntryKey) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Example 8 with IdentityResourceKey

use of org.olat.modules.coach.model.IdentityResourceKey in project openolat by klemens.

the class GroupController method event.

@Override
public void event(Event event) {
    if (event instanceof CertificateEvent) {
        CertificateEvent ce = (CertificateEvent) event;
        IdentityResourceKey key = new IdentityResourceKey(ce.getOwnerKey(), ce.getResourceKey());
        if (model.contains(key)) {
            updateCertificate(ce.getCertificateKey());
        }
    }
}
Also used : CertificateEvent(org.olat.course.certificate.CertificateEvent) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey)

Example 9 with IdentityResourceKey

use of org.olat.modules.coach.model.IdentityResourceKey in project openolat by klemens.

the class StudentCoursesController method loadModel.

private List<EfficiencyStatementEntry> loadModel() {
    List<RepositoryEntry> courses = fullAccess ? coachingService.getUserCourses(student) : coachingService.getStudentsCourses(getIdentity(), student);
    List<EfficiencyStatementEntry> statements = coachingService.getEfficencyStatements(student, courses, userPropertyHandlers, getLocale());
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(student);
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(student.getKey(), certificate.getOlatResourceKey());
        certificateMap.put(key, certificate);
    }
    ConcurrentMap<IdentityRepositoryEntryKey, LectureBlockStatistics> lecturesMap = new ConcurrentHashMap<>();
    if (lectureModule.isEnabled()) {
        List<LectureBlockStatistics> lectureStats = lectureService.getParticipantLecturesStatistics(student);
        for (LectureBlockStatistics lectureStat : lectureStats) {
            IdentityRepositoryEntryKey key = new IdentityRepositoryEntryKey(student.getKey(), lectureStat.getRepoKey());
            lecturesMap.put(key, lectureStat);
        }
    }
    model.setObjects(statements, certificateMap, lecturesMap);
    tableEl.reset();
    tableEl.reloadData();
    return statements;
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) LectureBlockStatistics(org.olat.modules.lecture.model.LectureBlockStatistics) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey) IdentityRepositoryEntryKey(org.olat.modules.coach.model.IdentityRepositoryEntryKey) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Example 10 with IdentityResourceKey

use of org.olat.modules.coach.model.IdentityResourceKey in project openolat by klemens.

the class CourseController method loadModel.

public List<EfficiencyStatementEntry> loadModel() {
    List<EfficiencyStatementEntry> entries = coachingService.getCourse(getIdentity(), course, userPropertyHandlers, getLocale());
    Long resourceKey = course.getOlatResource().getKey();
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(course.getOlatResource());
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(certificate.getIdentityKey(), resourceKey);
        certificateMap.put(key, certificate);
    }
    model.setObjects(entries, certificateMap);
    tableEl.reloadData();
    tableEl.reset();
    return entries;
}
Also used : EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey)

Aggregations

IdentityResourceKey (org.olat.modules.coach.model.IdentityResourceKey)10 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)6 CertificateLight (org.olat.course.certificate.CertificateLight)6 EfficiencyStatementEntry (org.olat.modules.coach.model.EfficiencyStatementEntry)6 CertificateEvent (org.olat.course.certificate.CertificateEvent)2 IdentityRepositoryEntryKey (org.olat.modules.coach.model.IdentityRepositoryEntryKey)2 LectureBlockStatistics (org.olat.modules.lecture.model.LectureBlockStatistics)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2