Search in sources :

Example 1 with DropBoxRow

use of org.olat.course.nodes.pf.ui.DropBoxRow in project OpenOLAT by OpenOLAT.

the class PFManager method getParticipants.

/**
 * Gets the participants for different group or course coaches as TableModel.
 *
 * @param id the identity
 * @param pfNode
 * @param userPropertyHandlers
 * @param locale
 * @param courseEnv
 * @param admin
 * @return the participants
 */
public List<DropBoxRow> getParticipants(Identity id, PFCourseNode pfNode, List<UserPropertyHandler> userPropertyHandlers, Locale locale, CourseEnvironment courseEnv, boolean admin) {
    List<Identity> identityList = getParticipants(id, courseEnv, admin);
    Set<Identity> duplicates = new HashSet<>();
    List<DropBoxRow> participants = new ArrayList<>(identityList.size());
    for (Identity identity : identityList) {
        if (duplicates.contains(identity)) {
            continue;
        }
        duplicates.add(identity);
        VFSContainer dropbox = resolveOrCreateDropFolder(courseEnv, pfNode, identity);
        int filecount = countFiles(dropbox);
        VFSContainer returnbox = resolveOrCreateReturnFolder(courseEnv, pfNode, identity);
        int filecountR = countFiles(returnbox);
        Date lastModified = getLastUpdated(courseEnv, pfNode, identity, FILENAME_DROPBOX);
        Date lastModifiedR = getLastUpdated(courseEnv, pfNode, identity, FILENAME_RETURNBOX);
        UserPropertiesRow urow = new UserPropertiesRow(identity, userPropertyHandlers, locale);
        participants.add(new DropBoxRow(urow, "status", filecount, filecountR, pfNode.getLimitCount(), lastModified, lastModifiedR));
    }
    return participants;
}
Also used : DropBoxRow(org.olat.course.nodes.pf.ui.DropBoxRow) VFSContainer(org.olat.core.util.vfs.VFSContainer) ArrayList(java.util.ArrayList) UserPropertiesRow(org.olat.user.UserPropertiesRow) Identity(org.olat.core.id.Identity) Date(java.util.Date) HashSet(java.util.HashSet)

Example 2 with DropBoxRow

use of org.olat.course.nodes.pf.ui.DropBoxRow in project openolat by klemens.

the class PFManager method getParticipants.

/**
 * Gets the participants for different group or course coaches as TableModel.
 *
 * @param id the identity
 * @param pfNode
 * @param userPropertyHandlers
 * @param locale
 * @param courseEnv
 * @param admin
 * @return the participants
 */
public List<DropBoxRow> getParticipants(Identity id, PFCourseNode pfNode, List<UserPropertyHandler> userPropertyHandlers, Locale locale, CourseEnvironment courseEnv, boolean admin) {
    List<Identity> identityList = getParticipants(id, courseEnv, admin);
    Set<Identity> duplicates = new HashSet<>();
    List<DropBoxRow> participants = new ArrayList<>(identityList.size());
    for (Identity identity : identityList) {
        if (duplicates.contains(identity)) {
            continue;
        }
        duplicates.add(identity);
        VFSContainer dropbox = resolveOrCreateDropFolder(courseEnv, pfNode, identity);
        int filecount = countFiles(dropbox);
        VFSContainer returnbox = resolveOrCreateReturnFolder(courseEnv, pfNode, identity);
        int filecountR = countFiles(returnbox);
        Date lastModified = getLastUpdated(courseEnv, pfNode, identity, FILENAME_DROPBOX);
        Date lastModifiedR = getLastUpdated(courseEnv, pfNode, identity, FILENAME_RETURNBOX);
        UserPropertiesRow urow = new UserPropertiesRow(identity, userPropertyHandlers, locale);
        participants.add(new DropBoxRow(urow, "status", filecount, filecountR, pfNode.getLimitCount(), lastModified, lastModifiedR));
    }
    return participants;
}
Also used : DropBoxRow(org.olat.course.nodes.pf.ui.DropBoxRow) VFSContainer(org.olat.core.util.vfs.VFSContainer) ArrayList(java.util.ArrayList) UserPropertiesRow(org.olat.user.UserPropertiesRow) Identity(org.olat.core.id.Identity) Date(java.util.Date) HashSet(java.util.HashSet)

Aggregations

ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 HashSet (java.util.HashSet)2 Identity (org.olat.core.id.Identity)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 DropBoxRow (org.olat.course.nodes.pf.ui.DropBoxRow)2 UserPropertiesRow (org.olat.user.UserPropertiesRow)2