Examples of MessageForm


Examples of org.jresearch.gossip.forms.MessageForm

   */
  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    MessageForm messageForm = new MessageForm();
    ProcessMessageForm pmForm = (ProcessMessageForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    try {
     
View Full Code Here

Examples of org.jresearch.gossip.forms.MessageForm

     */
    public ActionForward process(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws SystemException {
        HttpSession session = request.getSession();
        MessageForm messageForm = (MessageForm) form;
        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        ForumDAO dao = ForumDAO.getInstance();

        try {
           

            boolean isUserMod = dao.checkMod(Integer.parseInt(
                        messageForm.getFid()), user);
            Forum currForum = dao.getForumInfo(Integer.parseInt(
                        messageForm.getFid()));

            //      check access rights if forum invisible
            if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE) &&
                    (user.getStatus() < Integer.parseInt(
                        Configurator.getInstance().get(IConst.CONFIG.INVADER1)))) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }

            Topic currThread = dao.getThreadInfo(Integer.parseInt(
                        messageForm.getTid()));

            // check user access rights if current topic or completely forum is locked
            if (((currThread.getLocked() == IConst.Topic.STATUS_LOCKED) ||
                    (currForum.getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED)) &&
                    (!isUserMod)) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }

            Message mess = dao.getMessage(messageForm.getMid());
            session.removeAttribute(IConst.REQUEST.CURR_THREAD);

            if (mess == null) {
                return (new ActionForward("/ShowThread.do?fid=" +
                    messageForm.getFid() + "&tid=" + messageForm.getTid() +
                    "&block=" + messageForm.getBlock(), true));
            } else {
                // check user access rights
                if (dao.checkMod(Integer.parseInt(messageForm.getFid()), user) ||
                        (user.getName().equals(mess.getSender()) &&
                        (currThread.getLocked() == IConst.Topic.STATUS_UNLOCKED))) {
                    dao.updateMessage(messageForm);

                    //subscribe user to e-mail from this thread...
                    if (IConst.VALUES.TRUE.equals(messageForm.getSubscribe())) {
                        dao.subscribe(messageForm.getTid(),
                            user.getInfo().getEmail(), user.getName());
                    }

                    log(request, "logs.LOG28",
                        " mid=" + messageForm.getMid() + " tid=" +
                        messageForm.getTid() + " fid=" + messageForm.getFid());
                } else {
                    return (mapping.findForward(IConst.TOKEN.DENIED));
                }
            }
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }

        StringBuffer forward = new StringBuffer();
        forward.append("/ShowMessage.do?fid=");
        forward.append(messageForm.getFid());
        forward.append("&tid=");
        forward.append(messageForm.getTid());
        forward.append("&mid=");
        forward.append(messageForm.getMid());

        return (new ActionForward(forward.toString(), true));
    }
View Full Code Here

Examples of org.jresearch.gossip.forms.MessageForm

   */
  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    MessageForm messageForm = new MessageForm();
    ForumDAO dao = ForumDAO.getInstance();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessMessageForm pmForm = (ProcessMessageForm) form;
    try {
     
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.