Package org.jresearch.gossip.forms

Examples of org.jresearch.gossip.forms.ProcessTopicForm


  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    try {
     
      dao.subscribe(ptForm.getTid(), user.getInfo().getEmail(), user
          .getName());
      setStatusMessage(request, "mails.CONFIRM_SUBSCR");
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
      throw new SystemException(sqle);
    }
    return (new ActionForward("/ShowThread.do?fid=" + ptForm.getFid()
        + "&tid=" + ptForm.getTid() + "&block=" + ptForm.getBlock(),
        true));
  }
View Full Code Here


  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    try {
      if (!dao.checkMod(Integer.parseInt(ptForm.getFid()), user)) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
     
      dao.deleteThread(ptForm.getTid(), true);
      log(request, "logs.LOG15", ptForm.getTid());
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
      throw new SystemException(sqle);
    }
    return (new ActionForward("/ShowForum.do?fid=" + ptForm.getFid(), true));
  }
View Full Code Here

   * @return DOCUMENT ME!
   */
  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    UserDAO userdao = UserDAO.getInstance();
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    int fid = Integer.parseInt(ptForm.getFid());
    int tid = Integer.parseInt(ptForm.getFid());
    try {
     
      Forum currForum = dao.getForumInfo(fid);
      //      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));
      }
      request.setAttribute(IConst.REQUEST.CURR_FORUM, currForum);
      session.setAttribute(IConst.SESSION.CURR_FORUM, currForum);
      updateLastVisitTime((HashMap) session
          .getAttribute(IConst.SESSION.LAST_INTIME), ptForm.getTid(),
          dao.now());
      RecordsData recordsData = new RecordsData();
      Topic currThread = dao.getThreadInfo(tid);
      dao.fillMessagesList(user, recordsData, ptForm);
      Iterator it = recordsData.getRecords().iterator();
      boolean attachEnabled = Configurator.getInstance().getBoolean(
          IConst.CONFIG.ENABLE_FILE_UPLOAD);
      if (it.hasNext()) {
        Message mess = (Message) it.next();
        currThread.setSubject(mess.getHeading());
        mess.setSenderInfo(userdao.getSenderInfo(mess.getSender()));
        if (attachEnabled) {
          mess.setAttachments(dao.getAttachmentsInfo(mess.getId()));
        }
      } else {
        return (new ActionForward("/ShowForum.do?fid="
            + ptForm.getFid(), true));
      }
      while (it.hasNext()) {
        Message mess = (Message) it.next();
        mess.setSenderInfo(userdao.getSenderInfo(mess.getSender()));
        if (attachEnabled) {
View Full Code Here

  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    try {
      if (!dao.checkMod(Integer.parseInt(ptForm.getFid()), user)) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
     
      dao.lockThread(ptForm.getTid());
      log(request, "logs.LOG21", ptForm.getTid());
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
      throw new SystemException(sqle);
    }
    return (new ActionForward("/ShowForum.do?fid=" + ptForm.getFid(), true));
  }
View Full Code Here

   */
  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    ForumDAO dao = ForumDAO.getInstance();
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    try {
     
      dao.moveThread(ptForm.getTid(), ptForm.getFid());
      log(request, "logs.LOG24", ptForm.getTid() + " to forum fid="
          + ptForm.getFid());
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
      throw new SystemException(sqle);
    }
    return (new ActionForward("/ShowForum.do?fid=" + ptForm.getFid(), true));
  }
View Full Code Here

  public ActionForward process(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws SystemException {
    HttpSession session = request.getSession();
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    ProcessTopicForm ptForm = (ProcessTopicForm) form;
    ForumDAO dao = ForumDAO.getInstance();
    try {
      if (!dao.checkMod(Integer.parseInt(ptForm.getFid()), user)) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
     
      dao.setThreadSortBy(ptForm.getTid(), 9);
      log(request, "logs.LOG21", ptForm.getTid());
    } catch (SQLException sqle) {
      getServlet().log("Connection.process", sqle);
      throw new SystemException(sqle);
    }
    return (new ActionForward("/ShowForum.do?fid=" + ptForm.getFid(), true));
  }
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.forms.ProcessTopicForm

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.