Package com.ourlinc.helloworld.model

Examples of com.ourlinc.helloworld.model.Comment


    List<Comment> result = new ArrayList<Comment>();
    ResultPage<Comment> rp = m_Podi.psCom.startsWith(null);
    rp.setPageSize(128);
    while (rp.gotoPage(rp.getPage() + 1)) {
      while (rp.hasNext()) {
        Comment com = rp.next();
        if (activityId.equals(com.getActivityId())
            && Comment.AVAILABLE == com.getStatus()) {
          result.add(com);
        }
      }
    }
    return ResultPage.OnList.wrap(result);
View Full Code Here


    public User getUserById(String id) {
      return m_userService.getUser(id);
    }

    public Comment postComment(Activity activity, User user, String content) {
      return new Comment(m_Podi, activity, user, content);
    }
View Full Code Here

    if (null == act || null == content) {
      request.setAttribute("errorMsg", "找不到id=" + actId + "的活动");
      return "error";
    }
    content = Misc.escapeHTML(content);
    Comment com = act.postComment(user, content);
    com.flush();
    response.sendRedirect("../activity/activity.jspx?actId="
        + URLEncoder.encode(actId, "utf-8"));
    return null;
  }
View Full Code Here

  @RequestMapping
  String deletecomment(HttpServletRequest request,
      HttpServletResponse response) throws IOException {
    String actId = request.getParameter("actId");
    String comId = request.getParameter("comId");
    Comment com = m_ActivityService.getComment(comId);
    if (null == actId) {
      request.setAttribute("errorMsg", "找不到id=" + actId + "的活动");
      return "error";
    }
    if (null == com) {
      request.setAttribute("errorMsg", "找不到id=" + comId + "的评论");
      return "error";
    }
    com.delete();
    com.flush();
    response.sendRedirect("../activity/activity.jspx?actId="
        + URLEncoder.encode(actId, "utf-8"));
    return null;
  }
View Full Code Here

TOP

Related Classes of com.ourlinc.helloworld.model.Comment

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.