Package com.liusoft.dlog4j.formbean

Examples of com.liusoft.dlog4j.formbean.FormBean


   */
  protected ActionForward doDeleteBookmarks(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception      
  {
    FormBean fbean = (FormBean) form;
    validateClientId(request, fbean);
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser != null){
      String[] bids = request.getParameterValues("bid");     
      BookmarkDAO.deleteBookmarks(loginUser.getId(), bids);
    }
    return makeForward(mapping.findForward("bookmark"), fbean.getSid());
  }
View Full Code Here


   */
  protected ActionForward beforeExecute(ActionMapping mapping, ActionForm form,
      HttpServletRequest req, HttpServletResponse res) throws Exception
  {   
    if(needVerify(req)){
      FormBean fbean = (FormBean)form;
      ActionMessages msgs = validateSiteOwner(req, res, fbean);
      if(!msgs.isEmpty()){
        Iterator iter = msgs.get();
        String msg = null;
        if(iter.hasNext()){
          ActionMessage am = (ActionMessage)iter.next();
          msg = super.getMessage(req, null, am.getKey());
        }
        String page = (fbean != null) ? fbean.getFromPage() : (req
            .getContextPath() + "/index.vm");
        return msgbox(mapping,form,req,res,msg,page);
      }
    }
    //�����������Ĵ�����
View Full Code Here

   * @ajax_enabled
   */
  protected ActionForward doAddFriend(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    FormBean fbean = (FormBean) form;
    validateClientId(request, fbean);
    String msg = null;
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser != null){
      int friendId = RequestUtils.getParam(request, "uid", -1);
      UserBean friend = UserDAO.getUserByID(friendId);
      if(friend==null)
        msg = getMessage(request,null,"error.user_not_found", new Integer(friendId));
      else if(friendId == loginUser.getId())
        msg = getMessage(request,null,"error.cannot_add_myself");
      else{
        FriendBean fb = new FriendBean();
        fb.setAddTime(new Date());
        fb.setFriend(friend);
        fb.setOwner(loginUser.getId());
        fb.setType(FriendBean.TYPE_GENERAL);
        fb.setRole(FriendBean.ROLE_GENERAL);
        UserDAO.addFriend(fb);
        msg = getMessage(request,null,"error.friend_added", new Integer(friendId));
      }
    }
    else
      msg = getMessage(request,null,"error.user_not_login");
    return msgbox(mapping,form,request,response,msg,fbean.getFromPage());
  }
View Full Code Here

   * http://localhost/dlog/user.do?sid=1&uid=223&eventSubmit_DelFriend
   */
  protected ActionForward doUnblockUser(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    FormBean fbean = (FormBean) form;
    validateClientId(request, fbean);
    String msg = null;
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser != null){
      String[] uids = request.getParameterValues("uid");
      UserDAO.deleteBlacklist(loginUser.getId(), uids);
      msg = getMessage(request,null,"error.user_delete_from_block", "");
    }
    else
      msg = getMessage(request,null,"error.user_not_login");
    return msgbox(mapping,form,request,response,msg,fbean.getFromPage());
  }
View Full Code Here

   * http://localhost/dlog/user.do?sid=1&uid=223&eventSubmit_DelFriend
   */
  protected ActionForward doDelFriend(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    FormBean fbean = (FormBean) form;
    validateClientId(request, fbean);
    String msg = null;
    //�ж��û��Ƿ��¼
    SessionUserObject loginUser = super.getLoginUser(request, response, false);
    if(loginUser != null){
      String[] uids = request.getParameterValues("uid");
      int er = UserDAO.deleteFriend(loginUser.getId(), uids);
      if(er>0)
        msg = getMessage(request,null,"error.friend_deleted");
    }
    else
      msg = getMessage(request,null,"error.user_not_login");
    return msgbox(mapping,form,request,response,msg,fbean.getFromPage());
  }
View Full Code Here

TOP

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

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.