Search in sources :

Example 1 with PFPeekviewController

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

the class PFCourseNode method createPeekViewRunController.

@Override
public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    VFSContainer rootFolder = null;
    CourseEnvironment courseEnv = userCourseEnv.getCourseEnvironment();
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    Path folderRelPath = null;
    OlatRootFolderImpl baseContainer = courseEnv.getCourseBaseContainer();
    PFManager pfManager = CoreSpringFactory.getImpl(PFManager.class);
    if (userCourseEnv.isCoach() || userCourseEnv.isAdmin()) {
        folderRelPath = Paths.get(baseContainer.getBasefile().toPath().toString(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent());
        rootFolder = new LocalFolderImpl(folderRelPath.toFile());
    } else if (userCourseEnv.isParticipant()) {
        folderRelPath = Paths.get(baseContainer.getBasefile().toPath().toString(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent(), pfManager.getIdFolderName(identity));
        rootFolder = new LocalFolderImpl(folderRelPath.toFile());
    }
    if (rootFolder == null) {
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    } else {
        return new PFPeekviewController(ureq, wControl, rootFolder, getIdent(), 4);
    }
}
Also used : Path(java.nio.file.Path) PFManager(org.olat.course.nodes.pf.manager.PFManager) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) VFSContainer(org.olat.core.util.vfs.VFSContainer) PFPeekviewController(org.olat.course.nodes.pf.ui.PFPeekviewController) Identity(org.olat.core.id.Identity) LocalFolderImpl(org.olat.core.util.vfs.LocalFolderImpl)

Example 2 with PFPeekviewController

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

the class PFCourseNode method createPeekViewRunController.

@Override
public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    VFSContainer rootFolder = null;
    CourseEnvironment courseEnv = userCourseEnv.getCourseEnvironment();
    Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
    Path folderRelPath = null;
    OlatRootFolderImpl baseContainer = courseEnv.getCourseBaseContainer();
    PFManager pfManager = CoreSpringFactory.getImpl(PFManager.class);
    if (userCourseEnv.isCoach() || userCourseEnv.isAdmin()) {
        folderRelPath = Paths.get(baseContainer.getBasefile().toPath().toString(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent());
        rootFolder = new LocalFolderImpl(folderRelPath.toFile());
    } else if (userCourseEnv.isParticipant()) {
        folderRelPath = Paths.get(baseContainer.getBasefile().toPath().toString(), PFManager.FILENAME_PARTICIPANTFOLDER, getIdent(), pfManager.getIdFolderName(identity));
        rootFolder = new LocalFolderImpl(folderRelPath.toFile());
    }
    if (rootFolder == null) {
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    } else {
        return new PFPeekviewController(ureq, wControl, rootFolder, getIdent(), 4);
    }
}
Also used : Path(java.nio.file.Path) PFManager(org.olat.course.nodes.pf.manager.PFManager) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) VFSContainer(org.olat.core.util.vfs.VFSContainer) PFPeekviewController(org.olat.course.nodes.pf.ui.PFPeekviewController) Identity(org.olat.core.id.Identity) LocalFolderImpl(org.olat.core.util.vfs.LocalFolderImpl)

Aggregations

Path (java.nio.file.Path)2 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)2 Identity (org.olat.core.id.Identity)2 LocalFolderImpl (org.olat.core.util.vfs.LocalFolderImpl)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 PFManager (org.olat.course.nodes.pf.manager.PFManager)2 PFPeekviewController (org.olat.course.nodes.pf.ui.PFPeekviewController)2 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)2 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)2