use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.
the class PortfolioResultDetailsController method doOpenMap.
private void doOpenMap(UserRequest ureq, Binder binder) {
if (stackPanel instanceof TooledStackedPanel) {
binder = portfolioService.getBinderByKey(binder.getKey());
portfolioService.updateBinderUserInformations(binder, getIdentity());
List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCourseCoach(binder, rights);
BinderConfiguration config = BinderConfiguration.createConfig(binder);
BinderController binderCtrl = new BinderController(ureq, getWindowControl(), (TooledStackedPanel) stackPanel, secCallback, binder, config);
String displayName = StringHelper.escapeHtml(binder.getTitle());
stackPanel.pushController(displayName, binderCtrl);
binderCtrl.activate(ureq, null, null);
}
}
use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.
the class BinderOnePageController method loadPage.
private void loadPage(UserRequest ureq, Page page) {
String id = "page_w_" + (++counter);
VelocityContainer pageVC = createVelocityContainer(id, "page_content_print");
mainVC.put(id, pageVC);
components.add(id);
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
PageMetadataController metadatCtrl = new PageMetadataController(ureq, getWindowControl(), secCallback, page);
listenTo(metadatCtrl);
Component pageMetaCmp = metadatCtrl.getInitialComponent();
pageVC.put("meta", pageMetaCmp);
PageController pageCtrl = new PageController(ureq, getWindowControl(), new PortfolioPageProvider(page), renderingHints);
listenTo(pageCtrl);
pageCtrl.loadElements(ureq);
Component pageCmp = pageCtrl.getInitialComponent();
pageVC.put("page", pageCmp);
CommentAndRatingSecurityCallback commentSecCallback = new ReadOnlyCommentsSecurityCallback();
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, page.getKey());
UserCommentsController commentsCtrl = new UserCommentsController(ureq, getWindowControl(), ores, null, commentSecCallback);
listenTo(commentsCtrl);
if (commentsCtrl.getNumOfComments() > 0) {
pageVC.put("comments", commentsCtrl.getInitialComponent());
}
}
use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.
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;
}
}
use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.
the class ExportBinderAsCPResource method exportPage.
private void exportPage(Page page, ZipOutputStream zout) throws IOException {
WindowControl mockwControl = new WindowControlMocker();
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
PageMetadataController metadatCtrl = new PageMetadataController(ureq, mockwControl, secCallback, page);
PageController pageCtrl = new PageController(ureq, mockwControl, new PortfolioPageProvider(page), ExtendedMediaRenderingHints.toPrint());
pageCtrl.loadElements(ureq);
CommentAndRatingSecurityCallback commentSecCallback = new ReadOnlyCommentsSecurityCallback();
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, page.getKey());
UserCommentsController commentsCtrl = new UserCommentsController(ureq, mockwControl, ores, null, commentSecCallback);
Component metadata = metadatCtrl.getInitialComponent();
Component component = pageCtrl.getInitialComponent();
Component comments = commentsCtrl.getNumOfComments() > 0 ? commentsCtrl.getInitialComponent() : null;
String html = createResultHTML(metadata, component, comments, "o_page_export");
html = exportMedia(html, zout);
convertToZipEntry(zout, pageFilename(page), html);
pageCtrl.dispose();
metadatCtrl.dispose();
}
use of org.olat.modules.portfolio.BinderSecurityCallback in project OpenOLAT by OpenOLAT.
the class PortfolioHomeController method doOpenMyPages.
private MyPageListController doOpenMyPages(UserRequest ureq) {
removeAsListenerAndDispose(myPageListCtrl);
stackPanel.popUpToRootController(ureq);
OLATResourceable pagesOres = OresHelper.createOLATResourceableInstance("MyPages", 0l);
WindowControl swControl = addToHistory(ureq, pagesOres, null);
// owners of all pages
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForMyPageList();
myPageListCtrl = new MyPageListController(ureq, swControl, stackPanel, secCallback);
listenTo(myPageListCtrl);
stackPanel.pushController(translate("my.portfolio.pages.breadcrump"), myPageListCtrl);
return myPageListCtrl;
}
Aggregations