Search in sources :

Example 1 with BCPeekviewController

use of org.olat.course.nodes.bc.BCPeekviewController in project OpenOLAT by OpenOLAT.

the class BCCourseNode method createPeekViewRunController.

/**
 * @see org.olat.course.nodes.GenericCourseNode#createPeekViewRunController(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    if (ne.isAtLeastOneAccessible()) {
        updateModuleConfigDefaults(false);
        // Create a folder peekview controller that shows the latest two entries
        VFSContainer rootFolder = null;
        if (getModuleConfiguration().getBooleanSafe(BCCourseNodeEditController.CONFIG_AUTO_FOLDER)) {
            rootFolder = getNodeFolderContainer(this, userCourseEnv.getCourseEnvironment());
        } else {
            String subPath = getModuleConfiguration().getStringValue(BCCourseNodeEditController.CONFIG_SUBPATH, "");
            VFSItem item = userCourseEnv.getCourseEnvironment().getCourseFolderContainer().resolve(subPath);
            if (item instanceof VFSContainer) {
                rootFolder = (VFSContainer) item;
            }
        }
        if (rootFolder == null) {
            return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
        }
        rootFolder.setDefaultItemFilter(new SystemItemFilter());
        return new BCPeekviewController(ureq, wControl, rootFolder, getIdent(), 4);
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : BCPeekviewController(org.olat.course.nodes.bc.BCPeekviewController) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) SystemItemFilter(org.olat.core.util.vfs.filters.SystemItemFilter)

Example 2 with BCPeekviewController

use of org.olat.course.nodes.bc.BCPeekviewController in project openolat by klemens.

the class BCCourseNode method createPeekViewRunController.

/**
 * @see org.olat.course.nodes.GenericCourseNode#createPeekViewRunController(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    if (ne.isAtLeastOneAccessible()) {
        updateModuleConfigDefaults(false);
        // Create a folder peekview controller that shows the latest two entries
        VFSContainer rootFolder = null;
        if (getModuleConfiguration().getBooleanSafe(BCCourseNodeEditController.CONFIG_AUTO_FOLDER)) {
            rootFolder = getNodeFolderContainer(this, userCourseEnv.getCourseEnvironment());
        } else {
            String subPath = getModuleConfiguration().getStringValue(BCCourseNodeEditController.CONFIG_SUBPATH, "");
            VFSItem item = userCourseEnv.getCourseEnvironment().getCourseFolderContainer().resolve(subPath);
            if (item instanceof VFSContainer) {
                rootFolder = (VFSContainer) item;
            }
        }
        if (rootFolder == null) {
            return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
        }
        rootFolder.setDefaultItemFilter(new SystemItemFilter());
        return new BCPeekviewController(ureq, wControl, rootFolder, getIdent(), 4);
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : BCPeekviewController(org.olat.course.nodes.bc.BCPeekviewController) VFSContainer(org.olat.core.util.vfs.VFSContainer) VFSItem(org.olat.core.util.vfs.VFSItem) SystemItemFilter(org.olat.core.util.vfs.filters.SystemItemFilter)

Aggregations

VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VFSItem (org.olat.core.util.vfs.VFSItem)2 SystemItemFilter (org.olat.core.util.vfs.filters.SystemItemFilter)2 BCPeekviewController (org.olat.course.nodes.bc.BCPeekviewController)2