Examples of Forum


Examples of org.olat.modules.fo.Forum

   *      org.olat.course.run.userview.NodeEvaluation)
   */
  public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
      final UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
   
    Forum theForum = loadOrCreateForum(userCourseEnv);
    boolean isOlatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
    // Add message id to business path if nodemcd is available
    if (nodecmd != null) {
      try {
View Full Code Here

Examples of org.olat.modules.fo.Forum

  private Forum loadOrCreateForum(final UserCourseEnvironment userCourseEnv) {
    updateModuleConfigDefaults(false);       
    final ForumManager fom = ForumManager.getInstance();
    final CoursePropertyManager cpm = userCourseEnv.getCourseEnvironment().getCoursePropertyManager();
    final CourseNode thisCourseNode = this;
    Forum theForum = null;
   
    Codepoint.codepoint(FOCourseNode.class, "findCourseNodeProperty")
    Property forumKeyProp = cpm.findCourseNodeProperty(thisCourseNode, null, null, FORUM_KEY);
    //System.out.println("System.out.println - findCourseNodeProperty");
    if(forumKeyProp!=null) {
      // Forum does already exist, load forum with key from properties
      Long forumKey = forumKeyProp.getLongValue();
      theForum = fom.loadForum(forumKey);
      if (theForum == null) { throw new OLATRuntimeException(FOCourseNode.class, "Tried to load forum with key " + forumKey.longValue() + " in course "
        + userCourseEnv.getCourseEnvironment().getCourseResourceableId() + " for node " + thisCourseNode.getIdent()
        + " as defined in course node property but forum manager could not load forum.", null); }
    } else {
      //creates resourceable from FOCourseNode.class and the current node id as key
      OLATResourceable courseNodeResourceable = OresHelper.createOLATResourceableInstance(FOCourseNode.class, new Long(this.getIdent()));
      Codepoint.codepoint(FOCourseNode.class, "beforeDoInSync");   
      //System.out.println("System.out.println - beforeDoInSync");
      //o_clusterOK by:ld
      theForum = CoordinatorManager.getCoordinator().getSyncer().doInSync(courseNodeResourceable, new SyncerCallback<Forum>(){
        public Forum execute() {
        Forum forum = null;
        Long forumKey;             
        Codepoint.codepoint(FOCourseNode.class,"doInSync");
        //System.out.println("Codepoint - doInSync");
        Property forumKeyProperty = cpm.findCourseNodeProperty(thisCourseNode, null, null, FORUM_KEY);       
        if (forumKeyProperty == null) {
          // First call of forum, create new forum and save forum key as property         
          forum = fom.addAForum();
          forumKey = forum.getKey();
          forumKeyProperty = cpm.createCourseNodePropertyInstance(thisCourseNode, null, null, FORUM_KEY, null, forumKey, null, null);
          cpm.saveProperty(forumKeyProperty)
          //System.out.println("Forum added");
        } else {
          // Forum does already exist, load forum with key from properties
View Full Code Here

Examples of org.olat.modules.fo.Forum

  @Override
  public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv,
      NodeEvaluation ne) {
    if (ne.isAtLeastOneAccessible()) {
      // Create a forum peekview controller that shows the latest two messages   
      Forum theForum = loadOrCreateForum(userCourseEnv);
      Controller peekViewController = new FOPeekviewController(ureq, wControl, theForum, ne.getCourseNode().getIdent(), 2);
      return peekViewController;     
    } else {
      // use standard peekview
      return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
View Full Code Here

Examples of org.olat.modules.fo.Forum

    // loop over all dialog elements
    for (Iterator<DialogElement> iter = list.iterator(); iter.hasNext();) {
      DialogElement element = iter.next();
      element.getAuthor();
      element.getDate();
      Forum forum = forumMgr.loadForum(element.getForumKey());
      // do IndexForum
      doIndexAllMessages(courseNodeResourceContext, forum, indexWriter );
      // do Index File
      doIndexFile(element.getFilename(), element.getForumKey(), courseNodeResourceContext, indexWriter);
    }   
View Full Code Here

Examples of org.olat.modules.fo.Forum

  private List convertToThreadTrees(long forumId, ForumCallback forumCallback){
    List messages;
    List topNodeList = new ArrayList();
    ForumManager fm = ForumManager.getInstance();
    Long l = new Long(forumId);
    Forum f = fm.loadForum(l);
    messages = fm.getMessagesByForum(f);
   
    for (Iterator iterTop = messages.iterator(); iterTop.hasNext();) {
      Message msg = (Message) iterTop.next();
      if (msg.getParent() == null) {
View Full Code Here

Examples of org.olat.modules.fo.Forum

        selectedElement = dialogElmsMgr.findDialogElement(coursePropMgr, courseNode, entry.getForumKey());
        if(selectedElement == null){
          showInfo("element.already.deleted");
          return;
        }
        Forum forum = null;
        forum = forumMgr.loadForum(entry.getForumKey());
        content.contextPut("hasSelectedElement", Boolean.TRUE);
        content.contextPut("selectedElement", selectedElement);

        // display forum either inline or as popup
        String integration = (String) courseNode.getModuleConfiguration().get(DialogConfigForm.DIALOG_CONFIG_INTEGRATION);
       
        subsContext = CourseModule.createSubscriptionContext(userCourseEnv.getCourseEnvironment(), courseNode, forum.getKey().toString());
        forumCallback = new DialogNodeForumCallback(nodeEvaluation, isOlatAdmin, isGuestOnly, subsContext);
        content.contextPut("security", forumCallback);
       
        if (integration.equals(DialogConfigForm.CONFIG_INTEGRATION_VALUE_INLINE)) {
          Controller forumCtr = ForumUIFactory.getStandardForumController(ureq, getWindowControl(), forum, forumCallback);
View Full Code Here

Examples of org.olat.modules.fo.Forum

      String command = event.getCommand();
      if (command.equals(ACTION_SHOW_FILE)) {
        doFileDelivery(ureq, selectedElement.getForumKey());
      }
    } else if (source == uploadButton){
      Forum forum = forumMgr.addAForum();
      OlatRootFolderImpl forumContainer = getForumContainer(forum.getKey());
      fileUplCtr = new FileUploadController(getWindowControl(),forumContainer, ureq, (int)FolderConfig.getLimitULKB(), Quota.UNLIMITED, null, false);
      fileUplCtr.addControllerListener(this);
      recentDialogElement = new DialogElement();
      recentDialogElement.setForumKey(forum.getKey());
      recentDialogElement.setAuthor(ureq.getIdentity().getName());
      dialogPanel.setContent(fileUplCtr.getInitialComponent());
    }

  }
View Full Code Here

Examples of org.olat.modules.fo.Forum

        versioningContent.contextPut("diffs", diffs);
      } else if (command.equals(TabbedPaneChangedEvent.TAB_CHANGED) && compName.equals("vc_discuss")) {
        /***********************************************************************
         * tabbed pane change to discussion tab
         **********************************************************************/
        Forum forum = null;
        if (page.getForumKey() == 0) {
          forum = ForumManager.getInstance().addAForum();
          page.setForumKey(forum.getKey().longValue());
          WikiManager.getInstance().updateWikiPageProperties(ores, page);
        }
        forum = ForumManager.getInstance().loadForum(Long.valueOf(page.getForumKey()));
        // TODO enhance forum callback with subscription stuff               
        boolean isModerator = securityCallback.mayModerateForum();       
View Full Code Here

Examples of org.olat.modules.fo.Forum

    Property forumKeyProperty = npm.findProperty(null, null, CollaborationTools.PROP_CAT_BG_COLLABTOOLS, CollaborationTools.KEY_FORUM);
    // Check if forum-property exist
    if (forumKeyProperty != null) {
      Long forumKey = forumKeyProperty.getLongValue();
      Forum forum = fom.loadForum(forumKey);
      SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
      forumSearchResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLFORUM);
      forumSearchResourceContext.setDocumentType(TYPE);
      forumSearchResourceContext.setDocumentContext(businessGroup.getKey() + " " + forumKey);
      forumSearchResourceContext.setParentContextType(GroupDocument.TYPE);
View Full Code Here

Examples of org.olat.modules.fo.Forum

    Property forumKeyProperty = cpm.findCourseNodeProperty(courseNode, null, null, FOCourseNode.FORUM_KEY);
    // Check if forum-property exist
    if (forumKeyProperty != null) {
      Long forumKey = forumKeyProperty.getLongValue();
      Forum forum = fom.loadForum(forumKey);
//      SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
//      forumSearchResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLFORUM); // TODO:chg: Must be an other Class e.g. CourseRunMainController
      parentResourceContext.setDocumentType(TYPE);
      parentResourceContext.setDocumentContext(course.getResourceableId() + " " + courseNode.getIdent() + " " + forumKey);
      doIndexAllMessages(parentResourceContext, forum, indexWriter );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.