Package org.nemesis.forum.webapp.admin.bean

Examples of org.nemesis.forum.webapp.admin.bean.ThreadBean


     
     
      List tbs = new ArrayList();
      Iterator threadIterator = forum.threads(start,maxPageItems); //start,range

      ThreadBean tb = null;

      while (threadIterator.hasNext()) {
        ForumThread currentThread = (ForumThread) threadIterator.next();
        tb = new ThreadBean();
        tb.setId(currentThread.getID());
        tb.setForumID(forum.getID());
        tb.setCreationDate(currentThread.getCreationDate());
        tb.setModifiedDate(currentThread.getModifiedDate());
        tb.setApproved(currentThread.isApproved());
        tb.setNotApprovedMessages(currentThread.getMessageCount(false));
        tb.setReplies(currentThread.getMessageCount() - 1);
        tb.setTopic(currentThread.getName());

        Message rootMessage = currentThread.getRootMessage();
        MessageBean mb = new MessageBean();
        mb.setAnonymous(rootMessage.isAnonymous());
       
        UserBean ub = new UserBean();
        if(!rootMessage.isAnonymous()){
       
          User rootMessageUser = rootMessage.getUser();
          ub.setId(rootMessageUser.getID());
          ub.setUserName(rootMessageUser.getUsername());
          ub.setName(rootMessageUser.getName());
          ub.setEmail(rootMessageUser.getEmail());
         
        }else{
          //:NOTE: we suppose in front application : name & email message property for anonymous user
          ub.setUserName(rootMessage.getProperty("name"));
          ub.setEmail(rootMessage.getProperty("email"));
        }
       
        mb.setAuthor(ub);
        tb.setRootMessage(mb);
        tbs.add(tb);

      }
      request.setAttribute("tbs", tbs);
      request.setAttribute("formatDatePattern", getResources(request).getMessage(getLocale(request),"dateformat"));
View Full Code Here


      //fb.setThreads(forum.getThreadCount());
      //fb.setMessages(forum.getMessageCount());
      request.setAttribute("fb", fb);

      ForumThread thread = forum.getThread(Integer.parseInt(request.getParameter("threadID")));
      ThreadBean tb = new ThreadBean();
      tb.setId(thread.getID());
      tb.setForumID(forum.getID());
      tb.setCreationDate(thread.getCreationDate());
      tb.setModifiedDate(thread.getModifiedDate());
      tb.setApproved(thread.isApproved());
     
      tb.setNotApprovedMessages(thread.getMessageCount(false));
      tb.setMessages(thread.getMessageCount());
      tb.setReplies(thread.getMessageCount() - 1);
      tb.setTopic(thread.getName());
     

      TreeWalker walker = thread.treeWalker();
      Message rootMessage = walker.getRoot();
      populate(walker,tb,rootMessage,0);
View Full Code Here

TOP

Related Classes of org.nemesis.forum.webapp.admin.bean.ThreadBean

Copyright © 2018 www.massapicom. 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.