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;
}
}
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;
}
}
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());
}
}
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;
}
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);
}
Aggregations