예제 #1
0
  /** 初始化评论页面 */
  public String initCommentsSearchXForm() {
    PageInfo pageInfo = service.getCommentListByArticle(articleId, 1);

    XFormEncoder xFormEncoder = new XFormEncoder(CMSConstants.XFORM_TEMPLATE_COMMENTS_SEARCH);
    GridDataEncoder gridEncoder =
        new GridDataEncoder(pageInfo.getItems(), CMSConstants.GRID_TEMPLATE_COMMENTS);
    return print(
        new String[] {"SearchInfo", "CommentList", "PageList"},
        new Object[] {xFormEncoder, gridEncoder, pageInfo});
  }
예제 #2
0
  /**
   * 得到评论信息
   *
   * @return
   */
  public String getCommentList() {
    PageInfo pageInfo = null;
    if (!EasyUtils.isNullOrEmpty(keywords)) {
      pageInfo = service.searchCommentList(keywords, page);
    } else {
      pageInfo = service.getCommentListByArticle(articleId, page);
    }

    GridDataEncoder gridEncoder =
        new GridDataEncoder(pageInfo.getItems(), CMSConstants.GRID_TEMPLATE_COMMENTS);
    return print(new String[] {"CommentList", "PageList"}, new Object[] {gridEncoder, pageInfo});
  }