Package org.nemesis.forum

Examples of org.nemesis.forum.Message


    Message message = treeWalker.getRoot();
    return new MessageProxy(message, authorization, permissions);
  }

  public Message getChild(Message parent, int index) {
    Message message = treeWalker.getChild(parent, index);
    return new MessageProxy(message, authorization, permissions);
  }
View Full Code Here


      return thread.getMessageCount(approved);
  }


  public Message getRootMessage() {
    Message message = thread.getRootMessage();
    return new MessageProxy(message, authorization, permissions);
  }
View Full Code Here

  /**
   * Returns the next message.
   */
  public Object next() throws NoSuchElementException {
    Message message = null;
    currentIndex++;
    if (currentIndex >= messages.length) {
      throw new NoSuchElementException();
    }
    try {
      int messageID = messages[currentIndex];
      message = forum.getMessage(messageID);
      //Now, get the message from the it's thread so that filters are
      //applied to the message. This may seem a bit convuluted, but is
      //necessary.
      message = message.getForumThread().getMessage(messageID);
    } catch (Exception e) {
      log.error("", e);
    }
    return message;
  }
View Full Code Here

      throw new UnauthorizedException();
    }
  }

  public Message getMessage(int messageID) throws ForumMessageNotFoundException {
    Message message = thread.getMessage(messageID);
    //Apply the protection proxy and return message.
    return new MessageProxy(message, authorization, permissions);
  }
View Full Code Here

     
      //first, populate
      if (request.getParameter("messageBean.subject") == null) {
        MessageBean mb = new MessageBean();
        Message m =forum.getThread(Integer.parseInt(request.getParameter("threadID"))).getMessage(Integer.parseInt(request.getParameter("messageID")));

       
        mb.setForumID( Integer.parseInt(request.getParameter("id")));
        mb.setThreadID( Integer.parseInt(request.getParameter("threadID")));
        mb.setMessageID( m.getID());
        mb.setSubject( m.getSubject());
        mb.setContent( m.getBody());
       
        PropertyUtils.setProperty(form, "messageBean", mb);
        return mapping.findForward("view");
      }
     
      //save
      MessageBean mb = (MessageBean) PropertyUtils.getSimpleProperty(form, "messageBean");
      Message m =forum.getThread(mb.getThreadID()).getMessage(mb.getMessageID());
      m.setSubject(mb.getSubject());
      m.setBody(mb.getContent());
     

    } catch (NumberFormatException aee) {
      errors.add("general"new ActionError("editMessage.unauthorized"));
     
View Full Code Here

      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.Message

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.