Package com.liusoft.dlog4j.formbean

Examples of com.liusoft.dlog4j.formbean.BookmarkForm


  protected ActionForward doDelete(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response, String s_bm_id) throws Exception      
  {
    int bm_id = Integer.parseInt(s_bm_id);
    BookmarkForm bookmark = (BookmarkForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    if(loginUser!=null){
      try{
        BookmarkDAO.delete(loginUser.getId(), bm_id);
      }catch(Exception e){
        context().log("delete bookmark #"+s_bm_id+" failed.", e);
        throw e;
      }
    }
    return makeForward(mapping.findForward("bookmark"), bookmark.getSid());
  }
View Full Code Here


   */
  protected ActionForward doAdd(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception      
  {
    BookmarkForm bookmark = (BookmarkForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    String msg = null;
    if(loginUser!=null){
      BookmarkBean bean = new BookmarkBean();
      bean.setParentId(bookmark.getParentId());
      bean.setParentType(bookmark.getParentType());
      bean.setOwner(loginUser);
      bean.setSite(new SiteBean(bookmark.getSid()));
      bean.setTitle(bookmark.getTitle());
      try{
        if(BookmarkDAO.save(bean))
          msg = getMessage(request,null,"bookmark.created");
        else
          msg = getMessage(request,null,"error.bookmark.exists");
      }catch(Exception e){
        context().log("add bookmark failed.", e);
        msg = getMessage(request,null,"error.database", e.getMessage());
      }
    }
    else{
      msg = getMessage(request,null,"error.user_not_login");
    }
    return msgbox(mapping, form, request, response, msg, bookmark
        .getFromPage());
  }
View Full Code Here

TOP

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

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.