Search in sources :

Example 21 with BinderSecurityCallback

use of org.olat.modules.portfolio.BinderSecurityCallback in project openolat by klemens.

the class PortfolioAssessmentDetailsController method loadModel.

private void loadModel(UserRequest ureq, Binder loadedBinder) {
    if (loadedBinder == null) {
        mainVC.contextPut("noMap", Boolean.TRUE);
    } else {
        Formatter formatter = Formatter.getInstance(getLocale());
        String templateTitle = loadedBinder.getTemplate().getTitle();
        mainVC.contextPut("templateTitle", templateTitle);
        String copyDate = "";
        if (loadedBinder.getCopyDate() != null) {
            copyDate = formatter.formatDateAndTime(loadedBinder.getCopyDate());
        }
        mainVC.contextPut("copyDate", copyDate);
        String returnDate = "";
        if (loadedBinder.getReturnDate() != null) {
            returnDate = formatter.formatDateAndTime(loadedBinder.getReturnDate());
        }
        mainVC.contextPut("returnDate", returnDate);
        List<AccessRights> rights = portfolioService.getAccessRights(loadedBinder, getIdentity());
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCourseCoach(loadedBinder, rights);
        BinderConfiguration config = BinderConfiguration.createConfig(loadedBinder);
        assessmentCtrl = new BinderAssessmentController(ureq, getWindowControl(), secCallback, loadedBinder, config);
        listenTo(assessmentCtrl);
        mainVC.put("assessment", assessmentCtrl.getInitialComponent());
    }
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) Formatter(org.olat.core.util.Formatter) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Example 22 with BinderSecurityCallback

use of org.olat.modules.portfolio.BinderSecurityCallback in project openolat by klemens.

the class SharedPagesController method doSelectedPage.

private Activateable2 doSelectedPage(UserRequest ureq, SharedPageRow row) {
    removeAsListenerAndDispose(pageCtrl);
    Page reloadedPage = portfolioService.getPageByKey(row.getPageKey());
    Binder binder = reloadedPage.getSection().getBinder();
    OLATResourceable pageOres = OresHelper.createOLATResourceableInstance("Entry", reloadedPage.getKey());
    WindowControl swControl = addToHistory(ureq, pageOres, null);
    List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
    BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
    pageCtrl = new PageRunController(ureq, swControl, stackPanel, secCallback, reloadedPage, false);
    listenTo(pageCtrl);
    stackPanel.pushController(reloadedPage.getTitle(), pageCtrl);
    return pageCtrl;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) Binder(org.olat.modules.portfolio.Binder) OLATResourceable(org.olat.core.id.OLATResourceable) PageRunController(org.olat.modules.portfolio.ui.PageRunController) AssessedPage(org.olat.modules.portfolio.model.AssessedPage) Page(org.olat.modules.portfolio.Page) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl)

Example 23 with BinderSecurityCallback

use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.

the class SharedPagesController method doSelectedPage.

private Activateable2 doSelectedPage(UserRequest ureq, SharedPageRow row) {
    removeAsListenerAndDispose(pageCtrl);
    Page reloadedPage = portfolioService.getPageByKey(row.getPageKey());
    Binder binder = reloadedPage.getSection().getBinder();
    OLATResourceable pageOres = OresHelper.createOLATResourceableInstance("Entry", reloadedPage.getKey());
    WindowControl swControl = addToHistory(ureq, pageOres, null);
    List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
    BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
    pageCtrl = new PageRunController(ureq, swControl, stackPanel, secCallback, reloadedPage, false);
    listenTo(pageCtrl);
    stackPanel.pushController(reloadedPage.getTitle(), pageCtrl);
    return pageCtrl;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) Binder(org.olat.modules.portfolio.Binder) OLATResourceable(org.olat.core.id.OLATResourceable) PageRunController(org.olat.modules.portfolio.ui.PageRunController) AssessedPage(org.olat.modules.portfolio.model.AssessedPage) Page(org.olat.modules.portfolio.Page) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl)

Example 24 with BinderSecurityCallback

use of org.olat.modules.portfolio.BinderSecurityCallback in project openolat by klemens.

the class MySharedItemsController method doSelectBinder.

private BinderController doSelectBinder(UserRequest ureq, MySharedItemRow row) {
    Binder binder = portfolioService.getBinderByKey(row.getBinderKey());
    if (binder == null) {
        showWarning("warning.portfolio.not.found");
        return null;
    } else {
        removeAsListenerAndDispose(binderCtrl);
        portfolioService.updateBinderUserInformations(binder, getIdentity());
        OLATResourceable binderOres = OresHelper.createOLATResourceableInstance("Binder", binder.getKey());
        WindowControl swControl = addToHistory(ureq, binderOres, null);
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForOwnedBinder(binder);
        BinderConfiguration config = BinderConfiguration.createConfig(binder);
        binderCtrl = new BinderController(ureq, swControl, stackPanel, secCallback, binder, config);
        String displayName = StringHelper.escapeHtml(binder.getTitle());
        stackPanel.pushController(displayName, binderCtrl);
        return binderCtrl;
    }
}
Also used : Binder(org.olat.modules.portfolio.Binder) OLATResourceable(org.olat.core.id.OLATResourceable) BinderController(org.olat.modules.portfolio.ui.BinderController) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Example 25 with BinderSecurityCallback

use of org.olat.modules.portfolio.BinderSecurityCallback in project openolat by klemens.

the class SharedBindersController method doSelectBinder.

private BinderController doSelectBinder(UserRequest ureq, SharedItemRow row) {
    Binder binder = portfolioService.getBinderByKey(row.getBinderKey());
    if (binder == null) {
        showWarning("warning.portfolio.not.found");
        return null;
    } else {
        removeAsListenerAndDispose(binderCtrl);
        portfolioService.updateBinderUserInformations(binder, getIdentity());
        row.setRecentLaunch(new Date());
        OLATResourceable binderOres = OresHelper.createOLATResourceableInstance("Binder", binder.getKey());
        WindowControl swControl = addToHistory(ureq, binderOres, null);
        List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
        BinderConfiguration config = BinderConfiguration.createConfig(binder);
        binderCtrl = new BinderController(ureq, swControl, stackPanel, secCallback, binder, config);
        String displayName = StringHelper.escapeHtml(binder.getTitle());
        stackPanel.pushController(displayName, binderCtrl);
        return binderCtrl;
    }
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) AssessedBinder(org.olat.modules.portfolio.model.AssessedBinder) Binder(org.olat.modules.portfolio.Binder) OLATResourceable(org.olat.core.id.OLATResourceable) BinderController(org.olat.modules.portfolio.ui.BinderController) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) Date(java.util.Date) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Aggregations

BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)30 OLATResourceable (org.olat.core.id.OLATResourceable)18 WindowControl (org.olat.core.gui.control.WindowControl)16 BinderConfiguration (org.olat.modules.portfolio.BinderConfiguration)14 Binder (org.olat.modules.portfolio.Binder)12 BinderController (org.olat.modules.portfolio.ui.BinderController)12 AccessRights (org.olat.modules.portfolio.model.AccessRights)10 EPSecurityCallback (org.olat.portfolio.EPSecurityCallback)6 EPSecurityCallbackImpl (org.olat.portfolio.EPSecurityCallbackImpl)6 CalendarController (org.olat.commons.calendar.ui.CalendarController)4 WeeklyCalendarController (org.olat.commons.calendar.ui.WeeklyCalendarController)4 FolderRunController (org.olat.core.commons.modules.bc.FolderRunController)4 CommentAndRatingSecurityCallback (org.olat.core.commons.services.commentAndRating.CommentAndRatingSecurityCallback)4 UserCommentsController (org.olat.core.commons.services.commentAndRating.ui.UserCommentsController)4 Component (org.olat.core.gui.components.Component)4 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)4 Controller (org.olat.core.gui.control.Controller)4 CourseLinkProviderController (org.olat.course.run.calendar.CourseLinkProviderController)4 InfoGroupRunController (org.olat.group.ui.run.InfoGroupRunController)4 ChatToolController (org.olat.instantMessaging.ui.ChatToolController)4