use of org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback in project OpenOLAT by OpenOLAT.
the class EPTOCReadOnlyController method refreshTOC.
public void refreshTOC(UserRequest ureq) {
// do recursively
int level = 0;
List<TOCElement> tocList = new ArrayList<TOCElement>();
buildTOCModel(map, tocList, level);
vC.contextPut("tocList", tocList);
if (secCallback.canCommentAndRate()) {
removeAsListenerAndDispose(commentsAndRatingCtr);
boolean anonym = ureq.getUserSession().getRoles().isGuestOnly();
CommentAndRatingSecurityCallback callback = new CommentAndRatingDefaultSecurityCallback(getIdentity(), false, anonym);
commentsAndRatingCtr = new UserCommentsAndRatingsController(ureq, getWindowControl(), map.getOlatResource(), null, callback, true, true, true);
listenTo(commentsAndRatingCtr);
vC.put("commentCtrl", commentsAndRatingCtr.getInitialComponent());
}
}
use of org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback in project OpenOLAT by OpenOLAT.
the class RepositoryEntryListController method doOpenComments.
protected void doOpenComments(UserRequest ureq, RepositoryEntryRow row) {
if (commentsCtrl != null)
return;
boolean anonym = ureq.getUserSession().getRoles().isGuestOnly();
CommentAndRatingSecurityCallback secCallback = new CommentAndRatingDefaultSecurityCallback(getIdentity(), false, anonym);
commentsCtrl = new UserCommentsController(ureq, getWindowControl(), row.getRepositoryEntryResourceable(), null, secCallback);
commentsCtrl.setUserObject(row);
listenTo(commentsCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", commentsCtrl.getInitialComponent(), true, translate("comments"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback in project OpenOLAT by OpenOLAT.
the class RepositoryEntryDetailsController method doOpenComments.
protected void doOpenComments(UserRequest ureq) {
if (commentsCtrl != null)
return;
boolean anonym = ureq.getUserSession().getRoles().isGuestOnly();
CommentAndRatingSecurityCallback secCallback = new CommentAndRatingDefaultSecurityCallback(getIdentity(), false, anonym);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("RepositoryEntry", entry.getKey());
commentsCtrl = new UserCommentsController(ureq, getWindowControl(), ores, null, secCallback);
listenTo(commentsCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", commentsCtrl.getInitialComponent(), true, translate("comments"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback in project OpenOLAT by OpenOLAT.
the class AbstractPageListController method doComment.
private void doComment(UserRequest ureq, Page page) {
CommentAndRatingSecurityCallback commentSecCallback;
if (PageStatus.isClosed(page)) {
commentSecCallback = new ReadOnlyCommentsSecurityCallback();
} else {
commentSecCallback = new CommentAndRatingDefaultSecurityCallback(getIdentity(), false, false);
}
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, page.getKey());
commentsCtrl = new UserCommentsController(ureq, getWindowControl(), ores, null, commentSecCallback);
listenTo(commentsCtrl);
String title = translate("comment.title");
cmc = new CloseableModalController(getWindowControl(), null, commentsCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback in project OpenOLAT by OpenOLAT.
the class TableOfContentController method doOpenComments.
private void doOpenComments(UserRequest ureq, PageRow pageRow) {
CommentAndRatingSecurityCallback commentSecCallback;
if (PageStatus.isClosed(pageRow.getPage())) {
commentSecCallback = new ReadOnlyCommentsSecurityCallback();
} else {
commentSecCallback = new CommentAndRatingDefaultSecurityCallback(getIdentity(), false, false);
}
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Page.class, pageRow.getKey());
commentsCtrl = new UserCommentsController(ureq, getWindowControl(), ores, null, commentSecCallback);
listenTo(commentsCtrl);
String title = translate("comment.title");
cmc = new CloseableModalController(getWindowControl(), null, commentsCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
Aggregations