Search in sources :

Example 11 with BinderConfiguration

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

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 12 with BinderConfiguration

use of org.olat.modules.portfolio.BinderConfiguration 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 13 with BinderConfiguration

use of org.olat.modules.portfolio.BinderConfiguration 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 14 with BinderConfiguration

use of org.olat.modules.portfolio.BinderConfiguration 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

BinderConfiguration (org.olat.modules.portfolio.BinderConfiguration)14 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)14 WindowControl (org.olat.core.gui.control.WindowControl)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 BinderController (org.olat.modules.portfolio.ui.BinderController)8 AccessRights (org.olat.modules.portfolio.model.AccessRights)6 TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)4 Binder (org.olat.modules.portfolio.Binder)4 Date (java.util.Date)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 Formatter (org.olat.core.util.Formatter)2 AssessedBinder (org.olat.modules.portfolio.model.AssessedBinder)2 EPSecurityCallback (org.olat.portfolio.EPSecurityCallback)2 EPSecurityCallbackImpl (org.olat.portfolio.EPSecurityCallbackImpl)2