Search in sources :

Example 1 with BinderSecurityCallback

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

the class BinderListController method doOpenBinder.

protected BinderController doOpenBinder(UserRequest ureq, Binder binder) {
    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);
        listenTo(binderCtrl);
        stackPanel.pushController(binder.getTitle(), binderCtrl);
        return binderCtrl;
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Example 2 with BinderSecurityCallback

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

the class DeletedBinderController method doOpenBinder.

@Override
protected BinderController doOpenBinder(UserRequest ureq, Binder binder) {
    if (binder == null) {
        showWarning("warning.portfolio.not.found");
        return null;
    } else {
        removeAsListenerAndDispose(binderCtrl);
        OLATResourceable binderOres = OresHelper.createOLATResourceableInstance("Binder", binder.getKey());
        WindowControl swControl = addToHistory(ureq, binderOres, null);
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForDeletedBinder();
        BinderConfiguration config = BinderConfiguration.createConfig(binder);
        binderCtrl = new BinderController(ureq, swControl, stackPanel, secCallback, binder, config);
        listenTo(binderCtrl);
        stackPanel.pushController(binder.getTitle(), binderCtrl);
        return binderCtrl;
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) WindowControl(org.olat.core.gui.control.WindowControl) BinderConfiguration(org.olat.modules.portfolio.BinderConfiguration)

Example 3 with BinderSecurityCallback

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

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 4 with BinderSecurityCallback

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

the class PortfolioNotificationsHandler method createSubscriptionInfo.

@Override
public SubscriptionInfo createSubscriptionInfo(Subscriber subscriber, Locale locale, Date compareDate) {
    SubscriptionInfo si = null;
    Publisher publisher = subscriber.getPublisher();
    Binder binder = binderDao.loadByKey(publisher.getResId());
    if (isInkoveValid(binder, compareDate, publisher)) {
        BinderSecurityCallback secCallback = null;
        Identity identity = subscriber.getIdentity();
        if (binderDao.isMember(binder, identity, PortfolioRoles.owner.name())) {
            secCallback = BinderSecurityCallbackFactory.getCallbackForOwnedBinder(binder);
        } else {
            List<AccessRights> rights = portfolioService.getAccessRights(binder, identity);
            if (rights.size() > 0) {
                secCallback = BinderSecurityCallbackFactory.getCallbackForCoach(binder, rights);
            }
        }
        if (secCallback != null) {
            si = new SubscriptionInfo(subscriber.getKey(), publisher.getType(), getTitleItemForBinder(binder), null);
            List<SubscriptionListItem> allItems = getAllItems(binder, secCallback, compareDate, locale);
            for (SubscriptionListItem item : allItems) {
                // only a type of icon
                SubscriptionListItem clonedItem = new SubscriptionListItem(item.getDescription(), item.getDescriptionTooltip(), item.getLink(), item.getBusinessPath(), item.getDate(), "o_ep_icon");
                si.addSubscriptionListItem(clonedItem);
            }
        }
    }
    if (si == null) {
        // no info, return empty
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
    }
    return si;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) Binder(org.olat.modules.portfolio.Binder) SubscriptionListItem(org.olat.core.commons.services.notifications.model.SubscriptionListItem) SubscriptionInfo(org.olat.core.commons.services.notifications.SubscriptionInfo) Publisher(org.olat.core.commons.services.notifications.Publisher) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) Identity(org.olat.core.id.Identity)

Example 5 with BinderSecurityCallback

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

the class PortfolioConfigForm method doPreview.

private void doPreview(UserRequest ureq) {
    removeAsListenerAndDispose(previewCtr);
    removeAsListenerAndDispose(columnLayoutCtr);
    if (map != null) {
        EPSecurityCallback secCallback = new EPSecurityCallbackImpl(false, true);
        previewCtr = EPUIFactory.createPortfolioStructureMapPreviewController(ureq, getWindowControl(), map, secCallback);
    } else if (binder != null && stackPanel instanceof TooledStackedPanel) {
        BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
        BinderConfiguration bConfig = BinderConfiguration.createTemplateConfig(false);
        previewCtr = new BinderController(ureq, getWindowControl(), (TooledStackedPanel) stackPanel, secCallback, binder, bConfig);
    } else {
        return;
    }
    listenTo(previewCtr);
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewCtr);
    stackPanel.pushController(translate("preview.map"), columnLayoutCtr);
    listenTo(columnLayoutCtr);
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) BinderController(org.olat.modules.portfolio.ui.BinderController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) EPSecurityCallback(org.olat.portfolio.EPSecurityCallback) BinderSecurityCallback(org.olat.modules.portfolio.BinderSecurityCallback) EPSecurityCallbackImpl(org.olat.portfolio.EPSecurityCallbackImpl) 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