Пример #1
0
 /**
  * org.olat.lms.course.run.userview.UserCourseEnvironment,
  * org.olat.lms.course.run.userview.NodeEvaluation)
  */
 @Override
 public Controller createPeekViewRunController(
     final UserRequest ureq,
     final WindowControl wControl,
     final UserCourseEnvironment userCourseEnv,
     final NodeEvaluation ne) {
   if (ne.isAtLeastOneAccessible()) {
     // Create a feed peekview controller that shows the latest two entries
     final RepositoryEntry entry = getReferencedRepositoryEntry();
     final Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
     final String nodeId = this.getIdent();
     final boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
     final boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
     final SubscriptionContext subscriptionContext =
         CourseModule.createSubscriptionContext(userCourseEnv.getCourseEnvironment(), this);
     final FeedSecurityCallback callback =
         new FeedNodeSecurityCallback(ne, isAdmin, isGuest, subscriptionContext);
     final FeedUIFactory uiFactory = BlogUIFactory.getInstance(ureq.getLocale());
     final Controller peekViewController =
         new FeedPeekviewController(
             entry.getOlatResource(),
             ureq,
             wControl,
             callback,
             courseId,
             nodeId,
             uiFactory,
             2,
             "o_blog_peekview");
     return peekViewController;
   } else {
     // use standard peekview
     return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
   }
 }
Пример #2
0
 /**
  * org.olat.lms.course.run.userview.UserCourseEnvironment,
  * org.olat.lms.course.run.userview.NodeEvaluation, java.lang.String)
  */
 @Override
 public NodeRunConstructionResult createNodeRunConstructionResult(
     final UserRequest ureq,
     final WindowControl wControl,
     final UserCourseEnvironment userCourseEnv,
     final NodeEvaluation ne,
     final String nodecmd) {
   final RepositoryEntry entry = getReferencedRepositoryEntry();
   // create business path courseID:nodeID
   // userCourseEnv.getCourseEnvironment().getCourseResourceableId();
   // getIdent();
   final Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
   final String nodeId = this.getIdent();
   final boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
   final boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
   final SubscriptionContext subscriptionContext =
       CourseModule.createSubscriptionContext(userCourseEnv.getCourseEnvironment(), this);
   final FeedSecurityCallback callback =
       new FeedNodeSecurityCallback(ne, isAdmin, isGuest, subscriptionContext);
   ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(this));
   final FeedMainController blogCtr =
       BlogUIFactory.getInstance(ureq.getLocale())
           .createMainController(
               entry.getOlatResource(), ureq, wControl, callback, courseId, nodeId);
   blogCtr.activate(ureq, nodecmd);
   final Controller wrapperCtrl =
       TitledWrapperHelper.getWrapper(ureq, wControl, blogCtr, this, "o_blog_icon");
   final NodeRunConstructionResult result = new NodeRunConstructionResult(wrapperCtrl);
   return result;
 }