Search in sources :

Example 1 with FeedUIFactory

use of org.olat.modules.webFeed.ui.FeedUIFactory in project OpenOLAT by OpenOLAT.

the class PodcastCourseNode 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()) {
        // Create a feed peekview controller that shows the latest two entries
        RepositoryEntry entry = getReferencedRepositoryEntry();
        Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        String nodeId = this.getIdent();
        boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
        boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
        // fxdiff BAKS-18
        boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
        FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
        FeedUIFactory uiFactory = PodcastUIFactory.getInstance(ureq.getLocale());
        Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_podcast_peekview");
        return peekViewController;
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : FeedNodeSecurityCallback(org.olat.course.nodes.feed.FeedNodeSecurityCallback) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) PodcastNodeEditController(org.olat.course.nodes.feed.podcast.PodcastNodeEditController) FeedNodeEditController(org.olat.course.nodes.feed.FeedNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) FeedUIFactory(org.olat.modules.webFeed.ui.FeedUIFactory)

Example 2 with FeedUIFactory

use of org.olat.modules.webFeed.ui.FeedUIFactory in project OpenOLAT by OpenOLAT.

the class BlogCourseNode 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()) {
        // Create a feed peekview controller that shows the latest two entries
        RepositoryEntry entry = getReferencedRepositoryEntry();
        Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        String nodeId = this.getIdent();
        boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
        boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
        // fxdiff BAKS-18
        boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
        FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
        FeedUIFactory uiFactory = BlogUIFactory.getInstance(ureq.getLocale());
        Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_blog_peekview");
        return peekViewController;
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : FeedNodeSecurityCallback(org.olat.course.nodes.feed.FeedNodeSecurityCallback) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) BlogNodeEditController(org.olat.course.nodes.feed.blog.BlogNodeEditController) FeedNodeEditController(org.olat.course.nodes.feed.FeedNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) FeedUIFactory(org.olat.modules.webFeed.ui.FeedUIFactory)

Example 3 with FeedUIFactory

use of org.olat.modules.webFeed.ui.FeedUIFactory in project openolat by klemens.

the class BlogCourseNode 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()) {
        // Create a feed peekview controller that shows the latest two entries
        RepositoryEntry entry = getReferencedRepositoryEntry();
        Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        String nodeId = this.getIdent();
        boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
        boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
        // fxdiff BAKS-18
        boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
        FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
        FeedUIFactory uiFactory = BlogUIFactory.getInstance(ureq.getLocale());
        Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_blog_peekview");
        return peekViewController;
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : FeedNodeSecurityCallback(org.olat.course.nodes.feed.FeedNodeSecurityCallback) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) BlogNodeEditController(org.olat.course.nodes.feed.blog.BlogNodeEditController) FeedNodeEditController(org.olat.course.nodes.feed.FeedNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) FeedUIFactory(org.olat.modules.webFeed.ui.FeedUIFactory)

Example 4 with FeedUIFactory

use of org.olat.modules.webFeed.ui.FeedUIFactory in project openolat by klemens.

the class PodcastCourseNode 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()) {
        // Create a feed peekview controller that shows the latest two entries
        RepositoryEntry entry = getReferencedRepositoryEntry();
        Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
        String nodeId = this.getIdent();
        boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
        boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
        // fxdiff BAKS-18
        boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), entry);
        FeedSecurityCallback callback = new FeedNodeSecurityCallback(ne, isAdmin, isOwner, isGuest);
        FeedUIFactory uiFactory = PodcastUIFactory.getInstance(ureq.getLocale());
        Controller peekViewController = new FeedPeekviewController(entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId, uiFactory, 2, "o_podcast_peekview");
        return peekViewController;
    } else {
        // use standard peekview
        return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
}
Also used : FeedNodeSecurityCallback(org.olat.course.nodes.feed.FeedNodeSecurityCallback) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) PodcastNodeEditController(org.olat.course.nodes.feed.podcast.PodcastNodeEditController) FeedNodeEditController(org.olat.course.nodes.feed.FeedNodeEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) FeedPeekviewController(org.olat.course.nodes.feed.FeedPeekviewController) FeedUIFactory(org.olat.modules.webFeed.ui.FeedUIFactory)

Aggregations

Controller (org.olat.core.gui.control.Controller)4 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)4 NodeEditController (org.olat.course.editor.NodeEditController)4 FeedNodeEditController (org.olat.course.nodes.feed.FeedNodeEditController)4 FeedNodeSecurityCallback (org.olat.course.nodes.feed.FeedNodeSecurityCallback)4 FeedPeekviewController (org.olat.course.nodes.feed.FeedPeekviewController)4 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)4 FeedMainController (org.olat.modules.webFeed.ui.FeedMainController)4 FeedUIFactory (org.olat.modules.webFeed.ui.FeedUIFactory)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 BlogNodeEditController (org.olat.course.nodes.feed.blog.BlogNodeEditController)2 PodcastNodeEditController (org.olat.course.nodes.feed.podcast.PodcastNodeEditController)2