Package com.liusoft.dlog4j.formbean

Examples of com.liusoft.dlog4j.formbean.BBSForumForm


   * @throws Exception
   */
  protected ActionForward doLockForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response, String s_forum_id)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    int forum_id = Integer.parseInt(s_forum_id);
    BBSForumDAO.lockForumByID(forum.getSid(), forum_id);
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
  }
View Full Code Here


   * @throws Exception
   */
  protected ActionForward doHideForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response, String s_forum_id)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    int forum_id = Integer.parseInt(s_forum_id);
    BBSForumDAO.hideForumByID(forum.getSid(), forum_id);
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
  }
View Full Code Here

   * @throws Exception
   */
  protected ActionForward doDeleteForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response, String s_forum_id)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    int forum_id = Integer.parseInt(s_forum_id);
    BBSForumDAO.deleteForumByID(forum.getSid(), forum_id);
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
  }
View Full Code Here

   * @throws Exception
   */
  protected ActionForward doUpdateForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    super.validateClientId(request, forum);
    ForumBean fbean = BBSForumDAO.getForumByID(forum.getId());
    if(fbean!=null){
      if(StringUtils.isNotEmpty(forum.getName())&&!StringUtils.equals(fbean.getName(),forum.getName())){
        fbean.setName(forum.getName());
      }
      if(StringUtils.isNotEmpty(forum.getDesc())&&!StringUtils.equals(fbean.getDesc(),forum.getDesc())){
        fbean.setDesc(forum.getDesc());
      }
      if(fbean.getStatus()!=forum.getStatus()){
        int s = forum.getStatus();
        if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
          fbean.setStatus(forum.getStatus());
      }
      //�����������
      if(forum.getCatalog()>0){
        if(fbean.getCatalog()==null)
          fbean.setCatalog(new TypeBean(forum.getCatalog()));
        else if(fbean.getCatalog().getId()!=forum.getCatalog())
          fbean.setCatalog(new TypeBean(forum.getCatalog()));           
      }
      else if(fbean.getCatalog()!=null){
        fbean.setCatalog(null);
      }
     
      BBSForumDAO.flush();
    }
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
  }
View Full Code Here

   * @throws Exception
   */
  protected ActionForward doCreateForum(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSForumForm forum = (BBSForumForm)form;
    ActionMessages msgs = new ActionMessages();
    if(StringUtils.isEmpty(forum.getName())){
      msgs.add("name", new ActionMessage("error.forum_name_empty"));
    }
    else{     
      super.validateClientId(request, forum);
      SiteBean site = super.getSiteBean(request);
      ForumBean fbean = new ForumBean();
      fbean.setName(forum.getName());
      if(!StringUtils.isEmpty(forum.getDesc()))
        fbean.setDesc(forum.getDesc());
      fbean.setCreateTime(new Date());
      fbean.setSite(site);
      int s = forum.getStatus();
      if(s==ForumBean.STATUS_NORMAL||s==ForumBean.STATUS_HIDDEN||s==ForumBean.STATUS_LOCKED)
        fbean.setStatus(forum.getStatus());
      else
        fbean.setStatus(ForumBean.STATUS_NORMAL);
      if(forum.getCatalog()>0){
        fbean.setCatalog(new TypeBean(forum.getCatalog()));
      }
      BBSForumDAO.createForum(fbean, forum.getId(), forum.getDirection()==1);
    }
    if(!msgs.isEmpty()){
      saveMessages(request, msgs);
      return mapping.findForward("forum_add");
    }
    return super.makeForward(mapping.findForward("forums"), forum.getSid());
  }
View Full Code Here

   */
  protected ActionForward doMoveUp(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response, String s_forum_id)
      throws Exception
  {
    BBSForumForm lform = (BBSForumForm)form;
    try{
      int forum_id = Integer.parseInt(s_forum_id);
      BBSForumDAO.move(getSiteBean(request), forum_id, true);
    }catch(Exception e){
      context().log("move up forum #"+s_forum_id+" failed.", e);
    }
    return makeForward(mapping.findForward("forums"), lform.getSid());
  }
View Full Code Here

   */
  protected ActionForward doMoveDown(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response, String s_forum_id)
      throws Exception
  {
    BBSForumForm lform = (BBSForumForm)form;
    try{
      int forum_id = Integer.parseInt(s_forum_id);
      BBSForumDAO.move(getSiteBean(request), forum_id, false);
    }catch(Exception e){
      context().log("move up forum #"+s_forum_id+" failed.", e);
    }
    return makeForward(mapping.findForward("forums"), lform.getSid());
  }
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.formbean.BBSForumForm

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.