private void addPageRating(UserRequest ureq) {
if ( ! ContextHelpModule.isContextRatingEnabled()
|| ! ureq.getUserSession().isAuthenticated()
|| contextHelpPageVC == null ) return;
CommentAndRatingService commentAndRatingService = (CommentAndRatingService) ServiceFactory.getServiceOrNull(CommentAndRatingService.class);
if (commentAndRatingService != null) {
Roles roles = ureq.getUserSession().getRoles();
OLATResourceable helpOres = OresHelper.createOLATResourceableType("contexthelp");
String key = ContextHelpManager.getInstance().calculateCombinedKey(pageTranslator.getLocale(), bundleName, page);
commentAndRatingService.init(getIdentity(), helpOres, key, roles.isOLATAdmin(), roles.isGuestOnly());
UserCommentsAndRatingsController commentsAndRatingCtr = commentAndRatingService.createUserCommentsAndRatingControllerExpandable(ureq, getWindowControl());
listenTo(commentsAndRatingCtr);
contextHelpWrapperVC.put("commentsAndRatingCtr", commentsAndRatingCtr.getInitialComponent());
}
}