Search in sources :

Example 1 with FeedResourceSecurityCallback

use of org.olat.modules.webFeed.FeedResourceSecurityCallback in project OpenOLAT by OpenOLAT.

the class BlogHandler method createLaunchController.

/**
 * @see org.olat.repository.handlers.RepositoryHandler#getLaunchController(org.olat.core.id.OLATResourceable,
 *      java.lang.String, org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl)
 */
@Override
public MainLayoutController createLaunchController(final RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
    final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
    SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
    callback.setSubscriptionContext(subsContext);
    return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {

        @Override
        public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
            CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
            return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, BlogUIFactory.getInstance(uureq.getLocale()), callback, null);
        }
    });
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessmentMode(org.olat.course.assessment.AssessmentMode) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) RuntimeControllerCreator(org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) UserRequest(org.olat.core.gui.UserRequest)

Example 2 with FeedResourceSecurityCallback

use of org.olat.modules.webFeed.FeedResourceSecurityCallback in project OpenOLAT by OpenOLAT.

the class PodcastHandler method createLaunchController.

@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isOwner = reSecurity.isOwner();
    final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
    SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
    callback.setSubscriptionContext(subsContext);
    return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {

        @Override
        public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
            CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
            return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, PodcastUIFactory.getInstance(uureq.getLocale()), callback, null);
        }
    });
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessmentMode(org.olat.course.assessment.AssessmentMode) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) RuntimeControllerCreator(org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) UserRequest(org.olat.core.gui.UserRequest)

Example 3 with FeedResourceSecurityCallback

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

the class LiveBlogArtefactHandler method getSpecialMapViewController.

/**
 * @see org.olat.portfolio.EPAbstractHandler#getSpecialMapViewController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
 */
@Override
public Controller getSpecialMapViewController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact) {
    boolean isOwner = ureq.getIdentity().equalsByPersistableKey(artefact.getAuthor());
    FeedSecurityCallback callback = new FeedResourceSecurityCallback(ureq.getUserSession().getRoles().isOLATAdmin(), isOwner);
    String businessPath = artefact.getBusinessPath();
    Long resid = Long.parseLong(businessPath.substring(10, businessPath.length() - 1));
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(resid, BlogFileResource.TYPE_NAME);
    FeedItemDisplayConfig displayConfig = new FeedItemDisplayConfig(false, true, true);
    return BlogUIFactory.getInstance(ureq.getLocale()).createMainController(ores, ureq, wControl, callback, displayConfig);
}
Also used : FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) OLATResource(org.olat.resource.OLATResource) FeedItemDisplayConfig(org.olat.modules.webFeed.ui.FeedItemDisplayConfig) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback)

Example 4 with FeedResourceSecurityCallback

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

the class BlogHandler method createLaunchController.

/**
 * @see org.olat.repository.handlers.RepositoryHandler#getLaunchController(org.olat.core.id.OLATResourceable,
 *      java.lang.String, org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl)
 */
@Override
public MainLayoutController createLaunchController(final RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
    final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
    SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
    callback.setSubscriptionContext(subsContext);
    return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {

        @Override
        public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
            CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
            return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, BlogUIFactory.getInstance(uureq.getLocale()), callback, null);
        }
    });
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessmentMode(org.olat.course.assessment.AssessmentMode) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) RuntimeControllerCreator(org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) UserRequest(org.olat.core.gui.UserRequest)

Example 5 with FeedResourceSecurityCallback

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

the class PodcastHandler method createLaunchController.

@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
    boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isOwner = reSecurity.isOwner();
    final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
    SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
    callback.setSubscriptionContext(subsContext);
    return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {

        @Override
        public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
            CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
            return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, PodcastUIFactory.getInstance(uureq.getLocale()), callback, null);
        }
    });
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessmentMode(org.olat.course.assessment.AssessmentMode) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) FeedSecurityCallback(org.olat.modules.webFeed.FeedSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) FeedResourceSecurityCallback(org.olat.modules.webFeed.FeedResourceSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) FeedMainController(org.olat.modules.webFeed.ui.FeedMainController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) Controller(org.olat.core.gui.control.Controller) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) FeedRuntimeController(org.olat.modules.webFeed.ui.FeedRuntimeController) RuntimeControllerCreator(org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

FeedResourceSecurityCallback (org.olat.modules.webFeed.FeedResourceSecurityCallback)8 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)8 FeedMainController (org.olat.modules.webFeed.ui.FeedMainController)6 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)4 UserRequest (org.olat.core.gui.UserRequest)4 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)4 Controller (org.olat.core.gui.control.Controller)4 WindowControl (org.olat.core.gui.control.WindowControl)4 MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)4 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)4 AssessmentMode (org.olat.course.assessment.AssessmentMode)4 FeedItemDisplayConfig (org.olat.modules.webFeed.ui.FeedItemDisplayConfig)4 FeedRuntimeController (org.olat.modules.webFeed.ui.FeedRuntimeController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 RepositoryEntrySecurity (org.olat.repository.model.RepositoryEntrySecurity)4 RuntimeControllerCreator (org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator)4 OLATResource (org.olat.resource.OLATResource)4